From 7ef4270c2b6d7cf0959512edc25efd8ba3edc6ef Mon Sep 17 00:00:00 2001 From: Hsiao-nan Cheung Date: Mon, 29 Apr 2019 19:23:42 +0800 Subject: [PATCH] shim: Add '.com'-type shim (#3366) --- lib/core.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core.ps1 b/lib/core.ps1 index c5e42869a..13dd402b7 100644 --- a/lib/core.ps1 +++ b/lib/core.ps1 @@ -397,14 +397,14 @@ function shim($path, $global, $name, $arg) { "if(`$myinvocation.expectingInput) { `$input | & `$path $arg @args } else { & `$path $arg @args }" | out-file "$shim.ps1" -encoding utf8 -append } - if($path -match '\.exe$') { + if($path -match '\.(exe|com)$') { # for programs with no awareness of any shell Copy-Item "$(versiondir 'scoop' 'current')\supporting\shimexe\bin\shim.exe" "$shim.exe" -force write-output "path = $resolved_path" | out-file "$shim.shim" -encoding utf8 if($arg) { write-output "args = $arg" | out-file "$shim.shim" -encoding utf8 -append } - } elseif($path -match '\.((bat)|(cmd))$') { + } elseif($path -match '\.(bat|cmd)$') { # shim .bat, .cmd so they can be used by programs with no awareness of PSH "@`"$resolved_path`" $arg %*" | out-file "$shim.cmd" -encoding ascii