From 2034f5c9f6cf3fb9acbe7603ddb4602d3e01871b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 16 Aug 2024 15:16:28 +0200 Subject: [PATCH] Allow running installation in debug mode --- scripts/Windows/OS/Setup.ps1 | 1 + scripts/Windows/Scripts/PowerManagement.ps1 | 1 + winiso/deploy.fish | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/OS/Setup.ps1 b/scripts/Windows/OS/Setup.ps1 index 373cffa9..7bd2359f 100644 --- a/scripts/Windows/OS/Setup.ps1 +++ b/scripts/Windows/OS/Setup.ps1 @@ -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);" + diff --git a/scripts/Windows/Scripts/PowerManagement.ps1 b/scripts/Windows/Scripts/PowerManagement.ps1 index 6dc26435..7bef6087 100644 --- a/scripts/Windows/Scripts/PowerManagement.ps1 +++ b/scripts/Windows/Scripts/PowerManagement.ps1 @@ -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;"; diff --git a/winiso/deploy.fish b/winiso/deploy.fish index db91b9f8..d80e5425 100755 --- a/winiso/deploy.fish +++ b/winiso/deploy.fish @@ -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)" \