Skip to content

Commit 16f59b4

Browse files
tresfr15ch13
authored andcommitted
Add scoop prefix command (#2117)
1 parent 79bf99c commit 16f59b4

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

libexec/scoop-prefix.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Usage: scoop prefix <app>
2+
# Summary: Returns the path to the specified app
3+
param($app)
4+
5+
. "$psscriptroot\..\lib\core.ps1"
6+
. "$psscriptroot\..\lib\help.ps1"
7+
. "$psscriptroot\..\lib\manifest.ps1"
8+
. "$psscriptroot\..\lib\buckets.ps1"
9+
10+
reset_aliases
11+
12+
if(!$app) { my_usage; exit 1 }
13+
14+
$app_path = versiondir $app 'current' $false
15+
if(!(Test-Path $app_path)) {
16+
$app_path = versiondir $app 'current' $true
17+
}
18+
19+
if(Test-Path $app_path) {
20+
Write-Output $app_path
21+
} else {
22+
abort "Could not find app path for '$app'."
23+
}
24+
25+
exit 0

0 commit comments

Comments
 (0)