Skip to content

Commit

Permalink
Merge pull request #48 from fubarhouse/dev-1.8.x
Browse files Browse the repository at this point in the history
Release for 1.8.2
  • Loading branch information
fubarhouse authored Sep 30, 2017
2 parents 39ecdd8 + 0066e50 commit 0ce251a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
7 changes: 1 addition & 6 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,4 @@ node_packages:
- grunt
- replace
- underscore
- yosay

nodejs_folder_paths:
- path: "/usr/local/lib/node_modules"
- path: "/Users/{{ fubarhouse_user }}/.npm"
- path: "/Users/{{ fubarhouse_user }}/.nvm"
- yosay
10 changes: 5 additions & 5 deletions tasks/iojs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
register: fubarhouse_npm_io_install_result
changed_when: false
failed_when: false
when: '"{{ node_version }}" in iojs_available_versions.stdout_lines'
when: 'node_version in iojs_available_versions.stdout_lines'

- name: "IOJS | Check for all local installs"
stat:
path: "/usr/local/ivm/versions/{{ item }}"
register: fubarhouse_npm_io_install_results
changed_when: false
failed_when: false
when: '"{{ item }}" in iojs_available_versions.stdout'
when: 'item in iojs_available_versions.stdout'
with_items: "{{ node_versions }}"

- name: "IOJS | Install default"
Expand All @@ -48,19 +48,19 @@
shell: "{{ nvm_symlink_exec }} unalias default"
changed_when: false
failed_when: false
when: '"{{ node_version }}" in iojs_available_versions.stdout'
when: 'node_version in iojs_available_versions.stdout'

- name: "IOJS | Switch"
file:
src: "/usr/local/ivm/versions/{{ node_version }}/bin/node"
dest: "/usr/local/bin/iojs"
state: link
force: yes
when: '"{{ node_version }}" in iojs_available_versions.stdout'
when: 'node_version in iojs_available_versions.stdout'

- name: "IOJS | Verify version in use"
shell: "/usr/local/bin/ivm ls | grep ο | cat"
register: iojs_current_version
changed_when: false
failed_when: 'iojs_current_version.stdout.find("{{ node_version }}") == -1'
when: '"{{ node_version }}" in iojs_available_versions.stdout'
when: 'node_version in iojs_available_versions.stdout'
10 changes: 5 additions & 5 deletions tasks/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- name: "NodeJS | Install all requested versions"
shell: "{{ nvm_symlink_exec }} install {{ item }}"
when: '"{{ item }}" in nodejs_available_versions.stdout and item not in installed_nodejs_versions.stdout'
when: 'item in nodejs_available_versions.stdout and item not in installed_nodejs_versions.stdout'
with_items:
- "{{ node_version }}"
- "{{ node_versions }}"
Expand All @@ -17,12 +17,12 @@
shell: "{{ nvm_symlink_exec }} use --delete-prefix {{ node_version }}"
register: fubarhouse_npm_switch
changed_when: false
when: '"{{ node_version }}" in nodejs_available_versions.stdout'
when: 'node_version in nodejs_available_versions.stdout'

- name: "NodeJS | Linking"
shell: "{{ nvm_symlink_exec }} alias default {{ node_version }}"
changed_when: false
when: '"{{ node_version }}" in nodejs_available_versions.stdout'
when: 'node_version in nodejs_available_versions.stdout'

- name: "NodeJS | Linking binaries"
file:
Expand All @@ -33,7 +33,7 @@
with_items:
- node
- npm
when: '"{{ node_version }}" in nodejs_available_versions.stdout'
when: 'node_version in nodejs_available_versions.stdout'
changed_when: false

- name: "NodeJS | Import exports"
Expand All @@ -50,4 +50,4 @@
register: node_current_version
changed_when: false
failed_when: 'node_current_version.stdout.find("{{ node_version }}") == -1'
when: '"{{ node_version }}" in nodejs_available_versions.stdout'
when: 'node_version in nodejs_available_versions.stdout'
7 changes: 5 additions & 2 deletions tasks/nvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,15 @@

- name: "NVM | Ensure permissions are set"
file:
path: "{{ item.path }}"
path: "{{ item }}"
state: directory
mode: 0777
owner: "{{ fubarhouse_user }}"
recurse: no
with_items: "{{ nodejs_folder_paths }}"
with_items:
- "/usr/local/lib/node_modules"
- "{{ fubarhouse_user_dir }}/.npm"
- "{{ fubarhouse_user_dir }}/.nvm"
changed_when: false

- name: "NVM | Get distribution"
Expand Down

0 comments on commit 0ce251a

Please sign in to comment.