mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-09-26 15:26:21 +00:00
shim: Add '.com'-type shim (#3366)
This commit is contained in:
committed by
Richard Kuhnt
parent
f63219fd1d
commit
7ef4270c2b
+2
-2
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user