Files
Scoop/libexec/scoop-which.ps1
Rashil Gandhi 0f6d012d26 fix(shim): Add 'Get-CommandPath()' to find git (#4913)
Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
2022-05-27 10:18:41 +08:00

21 lines
466 B
PowerShell

# Usage: scoop which <command>
# Summary: Locate a shim/executable (similar to 'which' on Linux)
# Help: Locate the path to a shim/executable that was installed with Scoop (similar to 'which' on Linux)
param($command)
if (!$command) {
'ERROR: <command> missing'
my_usage
exit 1
}
$path = Get-CommandPath $command
if ($null -eq $path) {
Write-Host "'$command' not found / not a scoop shim."
exit 2
} else {
friendly_path $path
exit 0
}