"Fossies" - the Fresh Open Source Software Archive

Member "node-v12.18.4-win-x86/nodevars.bat" (14 Feb 2020, 702 Bytes) of package /windows/www/node-v12.18.4-win-x86.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) MS DOS Batch source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 @echo off
    2 
    3 rem Ensure this Node.js and npm are first in the PATH
    4 set "PATH=%APPDATA%\npm;%~dp0;%PATH%"
    5 
    6 setlocal enabledelayedexpansion
    7 pushd "%~dp0"
    8 
    9 rem Figure out the Node.js version.
   10 set print_version=.\node.exe -p -e "process.versions.node + ' (' + process.arch + ')'"
   11 for /F "usebackq delims=" %%v in (`%print_version%`) do set version=%%v
   12 
   13 rem Print message.
   14 if exist npm.cmd (
   15   echo Your environment has been set up for using Node.js !version! and npm.
   16 ) else (
   17   echo Your environment has been set up for using Node.js !version!.
   18 )
   19 
   20 popd
   21 endlocal
   22 
   23 rem If we're in the Node.js directory, change to the user's home dir.
   24 if "%CD%\"=="%~dp0" cd /d "%HOMEDRIVE%%HOMEPATH%"