update OS for macos
[webi-installers/.git] / node / node.bat
1 setlocal
2 @echo off
3 pushd "%userprofile%\.local\opt" || goto :error
4   powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://nodejs.org/dist/v12.16.2/node-v12.16.2-win-x64.zip -OutFile node-v12.16.2-win-x64.zip || goto :error
5   rem Windows BSD-tar handles zip. Imagine that.
6   tar xf node-v12.16.2-win-x64.zip || goto :error
7   dir
8   rename node-v12.16.2-win-x64 node-v12.16.2 || goto :error
9   rmdir node-v12.16.2-win-x64
10   del node-v12.16.2-win-x64.zip || goto :error
11 popd || goto :error
12
13 rem make npm not act stupid about which node to use... ugh (this should be the default)
14 "%userprofile%\.local\opt\node-v12.16.2\npm.cmd" --scripts-prepend-node-path=true config set scripts-prepend-node-path true
15 pathman add .local\opt\node-v12.16.2 || goto :error
16
17 goto :EOF
18
19 :error
20 echo Failed with error #%errorlevel%.
21 exit /b %errorlevel%