Skip to content

Instantly share code, notes, and snippets.

@oleics
Created February 9, 2012 15:55
Show Gist options
  • Save oleics/1780781 to your computer and use it in GitHub Desktop.
Save oleics/1780781 to your computer and use it in GitHub Desktop.
Let vcbuild.bat create a zip-archive of node and npm
rem Use curl and 7za
set NPM_VERSION=1.1.0-3
curl -o "%temp%\npm.zip" "http://nodejs.org/dist/npm-%NPM_VERSION%.zip"
if not exist "%temp%\npm" ( mkdir "%temp%\npm" )
7za x "%temp%\npm.zip" -o"%temp%\npm"
7za a -tzip "Release\node-v%NODE_VERSION%-win.zip" "Release\node.exe" "%temp%\npm\*" -mx9
rem Same but with wget and zip/unzip
set NPM_VERSION=1.1.0-3
wget -O "%temp%\npm.zip" "http://nodejs.org/dist/npm-%NPM_VERSION%.zip"
if not exist "%temp%\npm" ( mkdir "%temp%\npm" )
unzip "%temp%\npm.zip" -d "%temp%\npm"
zip -r9 "Release\node-v%NODE_VERSION%-win.zip" "Release\node.exe" "%temp%\npm\*"
rem Now upload "Release\node-v%NODE_VERSION%-win.zip" to nodejs.org/dist..
@oleics
Copy link
Author

oleics commented Feb 9, 2012

Questions:

How to determine the version of npm to use?

What tools are available?
How to unzip and zip in VC build env?
How to download in VC build env?

Is the build of npm stored already locally during build-process to avoid version-determination and the download?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment