mirror of
https://github.com/ScoopInstaller/Scoop.git
synced 2025-10-30 06:07:56 +00:00
fix(core): Use correct path in 'bash' (#6006)
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
- **scoop-info:** Fix download size estimating ([#5958](https://github.com/ScoopInstaller/Scoop/issues/5958))
|
||||
- **decompress:** Match `extract_dir`/`extract_to` and archives ([#5983](https://github.com/ScoopInstaller/Scoop/issues/5983))
|
||||
- **checkver:** Correct variable 'regex' to 'regexp' ([#5993](https://github.com/ScoopInstaller/Scoop/issues/5993))
|
||||
- **core:** Search for Git executable instead of any cmdlet ([#5998](https://github.com/ScoopInstaller/Scoop/pull/5998))
|
||||
- **core:** Search for Git executable instead of any cmdlet ([#5998](https://github.com/ScoopInstaller/Scoop/issues/5998))
|
||||
- **core:** Use correct path in 'bash' ([#6006](https://github.com/ScoopInstaller/Scoop/issues/6006))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
|
||||
20
lib/core.ps1
20
lib/core.ps1
@@ -1041,11 +1041,11 @@ function shim($path, $global, $name, $arg) {
|
||||
@(
|
||||
"#!/bin/sh",
|
||||
"# $resolved_path",
|
||||
"if [ `$(echo `$WSL_DISTRO_NAME) ]",
|
||||
"if [ `$WSL_INTEROP ]",
|
||||
'then',
|
||||
" cd `$(wslpath -u '$(Split-Path $resolved_path -Parent)')",
|
||||
'else',
|
||||
" cd `"$((Split-Path $resolved_path -Parent).Replace('\', '/'))`"",
|
||||
" cd `$(cygpath -u '$(Split-Path $resolved_path -Parent)')",
|
||||
'fi',
|
||||
"java.exe -jar `"$resolved_path`" $arg `"$@`""
|
||||
) -join "`n" | Out-UTF8File $shim -NoNewLine
|
||||
@@ -1058,7 +1058,7 @@ function shim($path, $global, $name, $arg) {
|
||||
|
||||
warn_on_overwrite $shim $path
|
||||
@(
|
||||
"#!/bin/sh",
|
||||
'#!/bin/sh',
|
||||
"# $resolved_path",
|
||||
"python.exe `"$resolved_path`" $arg `"$@`""
|
||||
) -join "`n" | Out-UTF8File $shim -NoNewLine
|
||||
@@ -1066,14 +1066,22 @@ function shim($path, $global, $name, $arg) {
|
||||
warn_on_overwrite "$shim.cmd" $path
|
||||
@(
|
||||
"@rem $resolved_path",
|
||||
"@bash `"$resolved_path`" $arg %*"
|
||||
"@bash `"`$(wslpath -u '$resolved_path')`" $arg %* 2>nul",
|
||||
'@if %errorlevel% neq 0 (',
|
||||
" @bash `"`$(cygpath -u '$resolved_path')`" $arg %* 2>nul",
|
||||
')'
|
||||
) -join "`r`n" | Out-UTF8File "$shim.cmd"
|
||||
|
||||
warn_on_overwrite $shim $path
|
||||
@(
|
||||
"#!/bin/sh",
|
||||
'#!/bin/sh',
|
||||
"# $resolved_path",
|
||||
"`"$resolved_path`" $arg `"$@`""
|
||||
"if [ `$WSL_INTEROP ]",
|
||||
'then',
|
||||
" `"`$(wslpath -u '$resolved_path')`" $arg `"$@`"",
|
||||
'else',
|
||||
" `"`$(cygpath -u '$resolved_path')`" $arg `"$@`"",
|
||||
'fi'
|
||||
) -join "`n" | Out-UTF8File $shim -NoNewLine
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user