From: AJ ONeal Date: Thu, 7 May 2020 05:34:54 +0000 (-0600) Subject: .bat => install.bat X-Git-Url: https://git.josue.xyz/?p=webi-installers%2F.git;a=commitdiff_plain;h=405bcd91f73f99f7242c903a79a6457ecb21bda1 .bat => install.bat --- diff --git a/node/install.bat b/node/install.bat new file mode 100644 index 0000000..b8ef142 --- /dev/null +++ b/node/install.bat @@ -0,0 +1,23 @@ +@echo off +setlocal +pushd "%userprofile%" || goto :error + pushd "%userprofile%\.local\opt" || goto :error + 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 + rem Windows BSD-tar handles zip. Imagine that. + tar xf node-v12.16.2-win-x64.zip || goto :error + dir + rename node-v12.16.2-win-x64 node-v12.16.2 || goto :error + rmdir node-v12.16.2-win-x64 + del node-v12.16.2-win-x64.zip || goto :error + popd || goto :error + + rem make npm not act stupid about which node to use... ugh (this should be the default) + .\.local\opt\node-v12.16.2\npm.cmd" --scripts-prepend-node-path=true config set scripts-prepend-node-path true || goto :error + pathman add .local\opt\node-v12.16.2 || goto :error +popd || goto :error + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% diff --git a/node/node.bat b/node/node.bat deleted file mode 100644 index b8ef142..0000000 --- a/node/node.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off -setlocal -pushd "%userprofile%" || goto :error - pushd "%userprofile%\.local\opt" || goto :error - 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 - rem Windows BSD-tar handles zip. Imagine that. - tar xf node-v12.16.2-win-x64.zip || goto :error - dir - rename node-v12.16.2-win-x64 node-v12.16.2 || goto :error - rmdir node-v12.16.2-win-x64 - del node-v12.16.2-win-x64.zip || goto :error - popd || goto :error - - rem make npm not act stupid about which node to use... ugh (this should be the default) - .\.local\opt\node-v12.16.2\npm.cmd" --scripts-prepend-node-path=true config set scripts-prepend-node-path true || goto :error - pathman add .local\opt\node-v12.16.2 || goto :error -popd || goto :error - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/pathman/install.bat b/pathman/install.bat new file mode 100644 index 0000000..67ae251 --- /dev/null +++ b/pathman/install.bat @@ -0,0 +1,19 @@ +pushd "%userprofile%" || goto :error + IF NOT EXIST .local ( + mkdir .local || goto :error + ) + IF NOT EXIST .local\bin ( + mkdir .local\bin || goto :error + ) + + pushd .local\bin || goto :error + rem TODO %PROCESSOR_ARCH% + powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest "https://rootprojects.org/pathman/dist/windows/amd64/pathman.exe" -OutFile pathman.exe || goto :error + popd || goto :error +popd + +goto :EOF + +:error +echo Failed with error #%errorlevel%. +exit /b %errorlevel% diff --git a/pathman/pathman.bat b/pathman/pathman.bat deleted file mode 100644 index 67ae251..0000000 --- a/pathman/pathman.bat +++ /dev/null @@ -1,19 +0,0 @@ -pushd "%userprofile%" || goto :error - IF NOT EXIST .local ( - mkdir .local || goto :error - ) - IF NOT EXIST .local\bin ( - mkdir .local\bin || goto :error - ) - - pushd .local\bin || goto :error - rem TODO %PROCESSOR_ARCH% - powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest "https://rootprojects.org/pathman/dist/windows/amd64/pathman.exe" -OutFile pathman.exe || goto :error - popd || goto :error -popd - -goto :EOF - -:error -echo Failed with error #%errorlevel%. -exit /b %errorlevel% diff --git a/webi/install.bat b/webi/install.bat new file mode 100644 index 0000000..30da18b --- /dev/null +++ b/webi/install.bat @@ -0,0 +1,2 @@ +rem do nothing because this is a special case +rem due to windows complexities, webinstall.bat is always installed to ~/.local/bin/webi.bat diff --git a/webi/webi.bat b/webi/webi.bat deleted file mode 100644 index 30da18b..0000000 --- a/webi/webi.bat +++ /dev/null @@ -1,2 +0,0 @@ -rem do nothing because this is a special case -rem due to windows complexities, webinstall.bat is always installed to ~/.local/bin/webi.bat diff --git a/webi/webinstall.bat b/webi/webinstall.bat index 50d18bf..065ba29 100644 --- a/webi/webinstall.bat +++ b/webi/webinstall.bat @@ -22,7 +22,7 @@ pushd "%userprofile%" || goto :error .\.local\bin\pathman add ".local\bin" || goto :error echo downloading and installing %1 - powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://webinstall.dev/packages/%1/%1.bat -OutFile %1-webinstall.bat || goto :error + powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://webinstall.dev/packages/%1/install.bat -OutFile %1-webinstall.bat || goto :error rem TODO only add if it's not in there already PATH .local\bin;%PATH%