X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=_webi%2Fbootstrap.ps1;h=0060fab4097432f625efd8406adff1041db281df;hb=9ee3af1afbb78333a74788ae1642ef539e2b80df;hp=168c457ff6a4c4e9b88516e69d7be4d9c8783568;hpb=17924e670fd56fa31ac6ebee8d8d7ee30b547358;p=webi-installers%2F.git diff --git a/_webi/bootstrap.ps1 b/_webi/bootstrap.ps1 index 168c457..0060fab 100644 --- a/_webi/bootstrap.ps1 +++ b/_webi/bootstrap.ps1 @@ -1,47 +1,6 @@ -#!/usr/bin/env pwsh - -# 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 -eq $null -or $Env:WEBI_HOST -eq "") -{ - $Env:WEBI_HOST = "https://webinstall.dev" -} - -# Fetch webi.bat -echo "$Env:WEBI_HOST/packages/_webi/webi.ps1" -curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1.bat" -o webi.bat -curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1" -o webi.ps1 - -popd - -# Run webi.ps1 -#TODO Set-ExecutionPolicy -ExecutionPolicy Bypass -Invoke-Expression "powershell -ExecutionPolicy Bypass .\.local\bin\webi.ps1 {{ 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.ps1" -o "$Env:USERPROFILE\.local\bin\webi.ps1" +Set-ExecutionPolicy -Scope Process Bypass +& "$Env:USERPROFILE\.local\bin\webi.ps1" "{{ exename }}"