Files
Scoop/libexec/scoop-which.ps1
HUMORCE 6d79d62cc8 fix(core): Handle scoop aliases and broken (edited,copied) shim (#5551)
* fix(core): Avoid error messages when shim broked, Allow get path for scoop aliases

* update `scoop-which`

* Add CHANGELOG entry

* Update CHANGELOG.md

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>

---------

Co-authored-by: Rashil Gandhi <46838874+rashil2000@users.noreply.github.com>
2023-10-03 18:59:10 +05:30

21 lines
476 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) {
warn "'$command' not found, not a scoop shim, or a broken shim."
exit 2
} else {
friendly_path $path
exit 0
}