Files
Scoop/libexec/scoop-prefix.ps1
2022-04-21 21:34:26 +08:00

24 lines
424 B
PowerShell

# Usage: scoop prefix <app>
# Summary: Returns the path to the specified app
param($app)
. "$PSScriptRoot\..\lib\versions.ps1" # 'currentdir' (indirectly)
if (!$app) {
my_usage
exit 1
}
$app_path = currentdir $app $false
if (!(Test-Path $app_path)) {
$app_path = currentdir $app $true
}
if (Test-Path $app_path) {
Write-Output $app_path
} else {
abort "Could not find app path for '$app'."
}
exit 0