Allow specifying version of node.js to install
This commit is contained in:
		
							parent
							
								
									a1af0b131e
								
							
						
					
					
						commit
						1868963b26
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -32,7 +32,7 @@ from fabric.contrib.files import append, exists | |||
| from rattail_fabric.util import get_home_path | ||||
| 
 | ||||
| 
 | ||||
| def install(user=None): | ||||
| def install(version=None, user=None): | ||||
|     """ | ||||
|     Install nvm and node.js for given user, or else "connection" user. | ||||
|     """ | ||||
|  | @ -52,7 +52,8 @@ def install(user=None): | |||
|     append(profile, '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"', **kwargs) | ||||
|     append(profile, '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"', **kwargs) | ||||
| 
 | ||||
|     cmd = "bash -l -c 'nvm install node'" | ||||
|     node = version or 'node' | ||||
|     cmd = "bash -l -c 'nvm install {}'".format(node) | ||||
|     if user: | ||||
|         sudo(cmd, user=user) | ||||
|     else: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Lance Edgar
						Lance Edgar