Last active
August 29, 2015 14:20
-
-
Save armornick/0f422b4aa8db092952a9 to your computer and use it in GitHub Desktop.
Portable Node Shell script for Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: set the local configuration directory -------------- | |
:: NOTE: also change nodevars.bat to use this instead of %APPDATA% | |
set NODE_PORTABLE_PREFIX=%~dp0local | |
:: NPM CONFIGURATIOn ---------------------------------- | |
:: set npm_config_key=value | |
:: ---------------------------------------------------- | |
set npm_config_prefix=%NODE_PORTABLE_PREFIX% | |
set npm_config_depth=0 | |
set npm_config_cache=%~dp0cache | |
:: only use offline cache | |
:: set npm_config_cache_min=999999 | |
:: if there are NO arguments, call shell | |
:: otherwise, just set variables | |
if "%1" == "" ( | |
:: START SHELL --------------------------------------- | |
cmd /k %~dp0nodejs\nodevars.bat | |
) else ( | |
:: call variables ------------------------------------- | |
%~dp0nodejs\nodevars.bat | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment