Allow running installation in debug mode

This commit is contained in:
Manuel Thalmann 2024-08-16 15:16:28 +02:00
parent 4c04935f2f
commit 2034f5c9f6
3 changed files with 10 additions and 1 deletions

View file

@ -230,6 +230,7 @@ function Start-Setup {
Add-StartupCommand `
-Script (
"powershell -Command " +
($env:DEBUG ? "`$env:DEBUG = $([int]$env:DEBUG)" : "") +
"`$env:PWSH_PATH = $(Get-PathInjection $env:PWSH_PATH);" +
"`$env:INSTALLER_SCRIPT = $(Get-ScriptPathInjection $env:SETUP_SCRIPT_NAME);" +
"`$env:CONFIG_MODULE = $(Get-ScriptPathInjection $env:CONFIG_MODULE);" +

View file

@ -59,6 +59,7 @@ $null = New-Module {
""
}
}) +
($env:DEBUG ? "`$env:DEBUG = $([int]$env:DEBUG)" : "") +
"`$env:INSTALLER_SCRIPT = $(ConvertTo-Injection (Resolve-Path $env:INSTALLER_SCRIPT));" +
"`$env:CONFIG_MODULE = $(ConvertTo-Injection (Resolve-Path $env:CONFIG_MODULE));" +
"& `$env:INSTALLER_SCRIPT;";

View file

@ -13,7 +13,7 @@ begin
sed "s/\//\\\\/g"
end
argparse --name (status filename) -x "iso,usb" "iso" "usb" -- $argv
argparse --name (status filename) -x "iso,usb" "iso" "usb" "debug" -- $argv
or exit 1
set -l setupLabel "winiso-valhalla"
@ -134,6 +134,13 @@ begin
"$git[5]\\bin"
) \
"set SETUP_LABEL=$setupLabel" \
(
begin
if [ -n "$_flag_debug"]
echo "set DEBUG=1"
end
end
) \
"set PWSH_PATH=$(echo "$pwshPath" | mkWinPath)" \
"set LOCAL_PROJECT_PATH=$(echo "$localProjectPath" | mkWinPath)" \
"set REMOTE_PROJECT_PATH=$(echo "$projectPath" | mkWinPath)" \