From ed6585161eb4b2ecd19c7f3f18cbf516995e5603 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 8 Aug 2024 18:21:16 +0200 Subject: [PATCH] Make config script platform independent --- scripts/Common/Scripts/Config.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/Common/Scripts/Config.ps1 b/scripts/Common/Scripts/Config.ps1 index 31e116ca..93b0247c 100644 --- a/scripts/Common/Scripts/Config.ps1 +++ b/scripts/Common/Scripts/Config.ps1 @@ -76,11 +76,16 @@ $null = New-Module { $scriptPath = "$PSScriptRoot/../../Common/Scripts/config.fish"; - function fish { - wsl --shell-type login -- nix --extra-experimental-features "nix-command flakes" run nixpkgs`#fish -- $args - } + if (-not $IsWindows) { + $escapedPath = (fish -c 'string escape $argv' "$scriptPath"); + fish -c ". $escapedPath; $Script"; + } else { + function fish { + wsl --shell-type login -- nix --extra-experimental-features "nix-command flakes" run nixpkgs`#fish -- $args + } - fish -c ". $(ConvertTo-LinuxPath $scriptPath); $Script" | ConvertFrom-Json; + fish -c ". $(ConvertTo-LinuxPath $scriptPath); $Script" | ConvertFrom-Json; + } } <#