Skip to content

Commit

Permalink
fix(nvm): Fix home path for NVM_DIR
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziwi01 committed Aug 27, 2024
1 parent fdf84a8 commit 3ee621d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ansible/roles/software/tasks/nvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@
ansible.builtin.file:
state: directory
path: "{{ ansible_env.HOME }}/.local/opt/nvm"
mode: "0755"

# TODO: do not install if already proper version installed
- name: "[NVM] Install NVM" # noqa no-changed-when
ansible.builtin.shell: |
export NVM_DIR="/home/ziwi/.local/opt/nvm"
set -e -o pipefail
export NVM_DIR="{{ ansible_env.HOME }}/.local/opt/nvm"
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v{{ nvm_version }}/install.sh | bash
args:
creates: "{{ ansible_env.HOME }}/.local/opt/nvm/nvm.sh"
register: nvm_result
changed_when: "'already installed' not in nvm_result.stdout"

- name: "[NVM] Show NVM install" # noqa no-changed-when
debug:
ansible.builtin.debug:
var: nvm_result.stdout

# TODO: Check if this version is already there for this user
Expand Down

0 comments on commit 3ee621d

Please sign in to comment.