Skip to content

Commit

Permalink
fix(zshrc): Ensure proper PATH is propagated in zshrc in case install…
Browse files Browse the repository at this point in the history
…ation fails before config part
  • Loading branch information
Ziwi01 committed Aug 27, 2024
1 parent 8ee0929 commit 8a684a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion ansible/roles/config/templates/zshrc.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
fi

# If you come from bash you might have to change your $PATH.
#export PATH=$HOME/.local/bin:$HOME/bin:/usr/local/bin:$PATH
export PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/bin

# Path to your oh-my-zsh installation.
Expand Down
6 changes: 6 additions & 0 deletions ansible/roles/software/tasks/zsh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
changed_when: not ohmyzsh.stat.exists
when: not ohmyzsh.stat.exists

- name: '[Zsh] Esnure ~/.loca/bin is added to PATH'
ansible.builtin.lineinfile:
path: "{{ ansible_env.HOME }}/.zshrc"
regexp: '^.*\.local/bin.*$'
line: 'export PATH=$PATH:$HOME/.local/bin:$HOME/bin:/usr/local/bin'

- name: "[Zsh] Plugins install/update"
ansible.builtin.git:
repo: "{{ item.value }}"
Expand Down

0 comments on commit 8a684a8

Please sign in to comment.