mirror of
				https://github.com/nvm-sh/nvm.git
				synced 2025-10-31 18:25:52 +08:00 
			
		
		
		
	When no arguments are passed to nvm run X, use nvm exec to open a REPL.
				
					
				
			Fixes #625. Tests will be in #717.
This commit is contained in:
		
							
								
								
									
										7
									
								
								nvm.sh
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								nvm.sh
									
									
									
									
									
								
							| @@ -1451,6 +1451,13 @@ nvm() { | |||||||
|       if [ "_$VERSION" = "_N/A" ]; then |       if [ "_$VERSION" = "_N/A" ]; then | ||||||
|         echo "$(nvm_ensure_version_prefix "$provided_version") is not installed yet" >&2 |         echo "$(nvm_ensure_version_prefix "$provided_version") is not installed yet" >&2 | ||||||
|         EXIT_CODE=1 |         EXIT_CODE=1 | ||||||
|  |       elif [ -z "$ARGS" ]; then | ||||||
|  |         if [ "$NVM_IOJS" = true ]; then | ||||||
|  |           nvm exec "$VERSION" iojs | ||||||
|  |         else | ||||||
|  |           nvm exec "$VERSION" node | ||||||
|  |         fi | ||||||
|  |         EXIT_CODE="$?" | ||||||
|       elif [ "$NVM_IOJS" = true ]; then |       elif [ "$NVM_IOJS" = true ]; then | ||||||
|         echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")" |         echo "Running io.js $(nvm_strip_iojs_prefix "$VERSION")" | ||||||
|         OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)" |         OUTPUT="$(nvm use "$VERSION" >/dev/null && iojs $ARGS)" | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user