From eaf1e8e9f3872cb8ebcc4b87392ebe8020b956ea Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Sun, 24 Nov 2024 22:55:12 +0100 Subject: [PATCH] using push/pop location instead to accommodate for powershell v5 --- util/windows.psm1 | 3 ++- util/wsl.psm1 | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/util/windows.psm1 b/util/windows.psm1 index 197c89e..eef66dc 100644 --- a/util/windows.psm1 +++ b/util/windows.psm1 @@ -94,6 +94,7 @@ function ProcessUrlFiles if (-not (Test-Path $tmpApp)) { New-Item -ItemType Directory -Path $tmpApp | Out-Null } + Push-Location Set-Location $tmpApp # Find all .url files in the source directory @@ -150,7 +151,7 @@ function ProcessUrlFiles Write-Host "Cloning $fileName from $url to $destinationPath..." -ForegroundColor Cyan git clone $url $destinationPath } - Set-Location - + Pop-Location } # Function to expand zip archives and copy to destination paths diff --git a/util/wsl.psm1 b/util/wsl.psm1 index def7177..493d58c 100644 --- a/util/wsl.psm1 +++ b/util/wsl.psm1 @@ -45,8 +45,10 @@ function InstallWSLNeovim Import-Module ./windows.psm1 ProcessUrlFiles -sourceDir $source + + Push-Location Set-Location "$env:TMP\nvim-config" Write-Host "Copying (forcably) configuration to WSL..." -ForegroundColor Yellow wsl.exe cp -rf . ~/.config/ 2>$null | Out-Null - Set-Location - + Pop-Location }