Skip to content

Commit bb5392b

Browse files
author
L. Yeung
authored
fix(shim): Remove character replacement in .cmd -> .ps1 shims (#4914)
1 parent f49f976 commit bb5392b

2 files changed

Lines changed: 3 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- **depends:** Avoid digits in archive file extension (except for .7z and .001) ([#4915](https://github.com/ScoopInstaller/Scoop/issues/4915))
77
- **bucket:** Don't check remote URL of non-git buckets ([#4923](https://github.com/ScoopInstaller/Scoop/issues/4923))
88
- **bucket:** Don't write message OK before bucket is cloned ([#4925](https://github.com/ScoopInstaller/Scoop/issues/4925))
9+
- **shim:** Remove character replacement in .cmd -> .ps1 shims ([#4914](https://github.com/ScoopInstaller/Scoop/issues/4914))
910

1011
### Documentation
1112

lib/core.ps1

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -679,19 +679,11 @@ function shim($path, $global, $name, $arg) {
679679
@(
680680
"@rem $resolved_path",
681681
"@echo off",
682-
"setlocal enabledelayedexpansion",
683-
"set args=%*",
684-
":: replace problem characters in arguments",
685-
"set args=%args:`"='%",
686-
"set args=%args:(=``(%",
687-
"set args=%args:)=``)%",
688-
"set invalid=`"='",
689-
"if !args! == !invalid! ( set args= )",
690682
"where /q pwsh.exe",
691683
"if %errorlevel% equ 0 (",
692-
" pwsh -noprofile -ex unrestricted -file `"$resolved_path`" $arg %args%",
684+
" pwsh -noprofile -ex unrestricted -file `"$resolved_path`" $arg %*",
693685
") else (",
694-
" powershell -noprofile -ex unrestricted -file `"$resolved_path`" $arg %args%",
686+
" powershell -noprofile -ex unrestricted -file `"$resolved_path`" $arg %*",
695687
")"
696688
) -join "`r`n" | Out-UTF8File "$shim.cmd"
697689

0 commit comments

Comments
 (0)