mirror of
https://github.com/casey/just.git
synced 2025-08-04 15:08:39 +00:00
Fix shell setting precedence (#1306)
This commit is contained in:
parent
c6809b3364
commit
7c0a960555
8 changed files with 130 additions and 84 deletions
29
examples/powershell.just
Normal file
29
examples/powershell.just
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Cross platform shebang:
|
||||
shebang := if os() == 'windows' {
|
||||
'powershell.exe'
|
||||
} else {
|
||||
'/usr/bin/env pwsh'
|
||||
}
|
||||
|
||||
# Set shell for non-Windows OSs:
|
||||
set shell := ["powershell", "-c"]
|
||||
|
||||
# Set shell for Windows OSs:
|
||||
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
|
||||
|
||||
# If you have PowerShell Core installed and want to use it,
|
||||
# use `pwsh.exe` instead of `powershell.exe`
|
||||
|
||||
linewise:
|
||||
Write-Host "Hello, world!"
|
||||
|
||||
shebang:
|
||||
#!{{shebang}}
|
||||
$PSV = $PSVersionTable.PSVersion | % {"$_" -split "\." }
|
||||
$psver = $PSV[0] + "." + $PSV[1]
|
||||
if ($PSV[2].Length -lt 4) {
|
||||
$psver += "." + $PSV[2] + " Core"
|
||||
} else {
|
||||
$psver += " Desktop"
|
||||
}
|
||||
echo "PowerShell $psver"
|
Loading…
Add table
Add a link
Reference in a new issue