2012-06-05 00:59:01 +08:00
|
|
|
@echo off
|
|
|
|
|
2013-03-10 01:22:00 +08:00
|
|
|
rem Ensure this Node.js and npm are first in the PATH
|
2012-06-22 21:11:17 +08:00
|
|
|
set PATH=%APPDATA%\npm;%~dp0;%PATH%
|
2012-06-05 00:59:01 +08:00
|
|
|
|
2013-03-08 08:28:18 +08:00
|
|
|
setlocal enabledelayedexpansion
|
2012-06-22 21:11:17 +08:00
|
|
|
pushd "%~dp0"
|
2013-03-08 08:28:18 +08:00
|
|
|
|
|
|
|
rem Figure out the node version.
|
2012-06-22 21:11:17 +08:00
|
|
|
set print_version=.\node.exe -p -e "process.versions.node + ' (' + process.arch + ')'"
|
|
|
|
for /F "usebackq delims=" %%v in (`%print_version%`) do set version=%%v
|
2013-03-08 08:28:18 +08:00
|
|
|
|
|
|
|
rem Print message.
|
|
|
|
if exist npm.cmd (
|
2013-03-10 01:22:00 +08:00
|
|
|
echo Your environment has been set up for using Node.js !version! and npm.
|
2013-03-08 08:28:18 +08:00
|
|
|
) else (
|
|
|
|
echo Your environment has been set up for using Node.js !version!.
|
|
|
|
)
|
|
|
|
|
2012-06-22 21:11:17 +08:00
|
|
|
popd
|
2012-06-05 03:39:23 +08:00
|
|
|
endlocal
|
2012-06-05 00:59:01 +08:00
|
|
|
|
2012-06-22 21:11:17 +08:00
|
|
|
rem If we're in the node.js directory, change to the user's home dir.
|
|
|
|
if "%CD%\"=="%~dp0" cd /d "%HOMEDRIVE%%HOMEPATH%"
|