ref(webi): run cmd.exe with %USERPROFILE% path rather than pushd / popd

This commit is contained in:
AJ ONeal
2023-11-11 21:01:04 -07:00
parent 37d9644530
commit ea36def846
+1 -1
View File
@@ -87,7 +87,7 @@ Push-Location $Env:USERPROFILE
New-Item -Path .local\bin -ItemType Directory -Force | Out-Null
# See note on Set-ExecutionPolicy above
Set-Content -Path .local\bin\webi.bat -Value "@echo off`r`npushd %USERPROFILE%`r`npowershell -ExecutionPolicy Bypass .local\bin\webi-pwsh.ps1 %1`r`npopd"
Set-Content -Path .local\bin\webi.bat -Value "@echo off`r`npowershell -ExecutionPolicy Bypass %USERPROFILE%\.local\bin\webi-pwsh.ps1 %*"
# Backwards-compat bugfix: remove old webi-pwsh.ps1 location
Remove-Item -Path .local\bin\webi.ps1 -Recurse -ErrorAction Ignore
if (!(Test-Path -Path .local\opt)) {