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