fix: skip gh-dash is gh-dash alread exists

This commit is contained in:
Marc 2024-09-29 13:10:28 -04:00
parent ec3765ce5c
commit da9f5c19f3
Signed by: marc
GPG key ID: 048E042F22B5DC79

View file

@ -4,8 +4,6 @@
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
args: args:
creates: "{{ lookup('ansible.builtin.env', 'HOME') }}/.oh-my-zsh" creates: "{{ lookup('ansible.builtin.env', 'HOME') }}/.oh-my-zsh"
- name: Install gh CLI extensions (gh-dash)
command: gh extension install dlvhdr/gh-dash
- name: Add zsh managed block - name: Add zsh managed block
blockinfile: blockinfile:
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc" path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.zshrc"
@ -16,6 +14,12 @@
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/starship.toml" path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/starship.toml"
marker: "# Marc's env managed block - {mark}" marker: "# Marc's env managed block - {mark}"
block: "{{ lookup('ansible.builtin.file', 'files/starship.toml') }}" block: "{{ lookup('ansible.builtin.file', 'files/starship.toml') }}"
- name: Check if gh-dash is installed
shell: gh extension list
register: gh_ext_list
- name: Install gh CLI extensions (gh-dash)
command: gh extension install dlvhdr/gh-dash
when: gh_ext_list.stdout.find('gh dash') == -1
- name: Ensure gh-dash config directory exists - name: Ensure gh-dash config directory exists
file: file:
path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash" path: "{{ lookup('ansible.builtin.env', 'HOME') }}/.config/gh-dash"