refactor: finish moving ssh-* scripts to own installers
[webi-installers/.git] / _webi / bootstrap.bat
1 setlocal
2 @echo off
3 pushd "%userprofile%" || goto :error
4   IF NOT EXIST .local (
5     mkdir .local || goto :error
6   )
7   IF NOT EXIST .local\bin (
8     mkdir .local\bin || goto :error
9   )
10
11   rem {{ baseurl }}
12   rem {{ version }}
13   pushd .local\bin || goto :error
14     if NOT EXIST webi.bat (
15       rem without SilentlyContinue this is SLOOOOOOOOOOOOOOOW!
16       powershell $ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest https://webinstall.dev/packages/_webi/webi.bat -OutFile webi.bat || goto :error
17     )
18     call .\webi {{ exename }} || goto :error
19     rem pathman add "%userprofile%\.local\bin" >nul 2>&1 || goto :error
20     pathman add "%userprofile%\.local\bin" || goto :error
21   popd || goto :error
22 popd
23
24 goto :EOF
25
26 :error
27 echo Failed with error #%errorlevel%.
28 exit /b %errorlevel%