Skip to content

Commit

Permalink
Create NVM role to add bash autocompletion and ensure ~/.nvm directory
Browse files Browse the repository at this point in the history
  • Loading branch information
adrw committed Jan 7, 2019
1 parent 2fd978b commit fff59e6
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ansible/plays/provision/mac_terminal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
- tmux
- vim
- ssh
- travis
- nvm
- go
- travis
- iterm2
# - oh-my-zsh
# - mas
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/homebrew/vars/homebrew_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ homebrew_packages:
- htop
- jhead # photo manipulation script
- node
- nvm
- openssl
- pngquant
- python
Expand All @@ -22,6 +21,7 @@ homebrew_packages:
# - antibody
# - dockutil
# - fasd
# - nvm
# - privoxy
# - syncthing
# - tmux
4 changes: 4 additions & 0 deletions ansible/roles/nvm/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nvm__div: "nvm"
nvm__init: "export NVM_DIR=\"$HOME/.nvm\"
\n[ -s \"{{ home }}/.homebrew/opt/nvm/nvm.sh\" ] && . \"{{ home }}/.homebrew/opt/nvm/nvm.sh\" # This loads nvm
\n[ -s \"{{ home }}/.homebrew/opt/nvm/etc/bash_completion\" ] && . \"{{ home }}/.homebrew/opt/nvm/etc/bash_completion\" # This loads nvm bash_completion"
Empty file.
Empty file.
12 changes: 12 additions & 0 deletions ansible/roles/nvm/meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
galaxy_info:
author: Andrew Alexander
company:
license: MIT
min_ansible_version: 2.0
platforms:
- name: Darwin
versions:
- trusty
- vivid
- xenial
dependencies: []
20 changes: 20 additions & 0 deletions ansible/roles/nvm/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- name: install nvm
homebrew:
name: nvm
- name: ensure ~/.nvm exists
file:
path: ~/.nvm
state: directory
owner: "{{ user_name }}"
group: "{{ user_group }}"
mode: 0644
- blockinfile:
dest: "{{ home }}/.bashrc"
marker: "### {mark} {{ nvm__div }}"
content: "{{ nvm__init }}"
create: true
- blockinfile:
dest: "{{ home }}/.zshrc"
marker: "### {mark} {{ nvm__div }}"
content: "{{ nvm__init }}"
create: true
Empty file.
Empty file added ansible/roles/nvm/vars/.gitkeep
Empty file.

0 comments on commit fff59e6

Please sign in to comment.