mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2026-09-22 05:15:54 +00:00
Merge pull request #437 from rivy/fix-shim-encoding
Change encoding of generated shim files to ASCII
This commit is contained in:
+6
-7
@@ -116,15 +116,14 @@ function shim($path, $global, $name, $arg) {
|
||||
$relative_path = resolve-path -relative $path
|
||||
popd
|
||||
|
||||
# note: use > for first line to replace file, then >> to append following lines
|
||||
echo '# ensure $HOME is set for MSYS programs' > $shim
|
||||
echo "if(!`$env:home) { `$env:home = `"`$home\`" }" >> $shim
|
||||
echo 'if($env:home -eq "\") { $env:home = $env:allusersprofile }' >> $shim
|
||||
echo "`$path = join-path `"`$psscriptroot`" `"$relative_path`"" >> $shim
|
||||
echo '# ensure $HOME is set for MSYS programs' | out-file $shim -encoding oem
|
||||
echo "if(!`$env:home) { `$env:home = `"`$home\`" }" | out-file $shim -encoding oem -append
|
||||
echo 'if($env:home -eq "\") { $env:home = $env:allusersprofile }' | out-file $shim -encoding oem -append
|
||||
echo "`$path = `"$path`"" | out-file $shim -encoding oem -append
|
||||
if($arg) {
|
||||
echo "`$args = '$($arg -join "', '")', `$args" >> $shim
|
||||
echo "`$args = '$($arg -join "', '")', `$args" | out-file $shim -encoding oem -append
|
||||
}
|
||||
echo 'if($myinvocation.expectingInput) { $input | & $path @args } else { & $path @args }' >> $shim
|
||||
echo 'if($myinvocation.expectingInput) { $input | & $path @args } else { & $path @args }' | out-file $shim -encoding oem -append
|
||||
|
||||
if($path -match '\.exe$') {
|
||||
# for programs with no awareness of any shell
|
||||
|
||||
Reference in New Issue
Block a user