X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=_webi%2Fbootstrap.ps1;h=ace4f3a7a388d931e21f305b35b629ba09c48e56;hb=2073a1eeebdcd30ffaddaf40e7c4940361bd5a08;hp=020d6b7f1f9f05a43715fb2650753e035d88a31f;hpb=94d013649b9cf13dcb690f583bc8cbd1fc716d41;p=webi-installers%2F.git diff --git a/_webi/bootstrap.ps1 b/_webi/bootstrap.ps1 index 020d6b7..ace4f3a 100644 --- a/_webi/bootstrap.ps1 +++ b/_webi/bootstrap.ps1 @@ -1,43 +1,6 @@ -# If a command returns an error, halt the script. -$ErrorActionPreference = 'Stop' - -# Ignore progress events from cmdlets so Invoke-WebRequest is not painfully slow -$ProgressPreference = 'SilentlyContinue' - -# Switch to userprofile -pushd $Env:USERPROFILE - -# Make paths if needed -if (!(Test-Path -Path .local\bin)) -{ - New-Item -Path .local\bin -ItemType Directory -} - -# {{ baseurl }} -# {{ version }} - -# Enter path -pushd .local\bin - -# TODO SetStrictMode -# TODO Test-Path variable:global:Env:WEBI_HOST ??? -IF(!$Env:WEBI_HOST) -{ - $Env:WEBI_HOST = "https://webinstall.dev" -} - -# Fetch webi.bat -Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1.bat" -OutFile webi.bat -Invoke-WebRequest "$Env:WEBI_HOST/packages/_webi/webi.ps1" -OutFile webi.ps1 - -popd - -# Run webi.bat -& .\.local\bin\webi.bat {{ exename }} - -# Run pathman to set up the folder -#& "$Env:USERPROFILE\.local\bin\pathman.exe" add "$Env:USERPROFILE\.local\.bin" -& "$Env:USERPROFILE\.local\bin\pathman.exe" add .local\.bin - -# Done -popd +# Download the latest webi, then install {{ exename }} +New-Item -Path .local\bin -ItemType Directory -Force +IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" } +curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi-pwsh.ps1" -o "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" +Set-ExecutionPolicy -Scope Process Bypass +& "$Env:USERPROFILE\.local\bin\webi-pwsh.ps1" "{{ exename }}"