forked from ScoopInstaller/Scoop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scoop.ps1
41 lines (35 loc) · 1.27 KB
/
scoop.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#requires -v 3
param($cmd)
set-strictmode -off
. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\git.ps1"
. "$psscriptroot\..\lib\buckets.ps1"
. (relpath '..\lib\commands')
reset_aliases
# TODO: remove this in a few weeks
if ((Get-LocalBucket) -notcontains 'main') {
warn "The main bucket of Scoop has been separated to 'https://github.com/ScoopInstaller/Main'"
warn "You don't have the main bucket added, adding main bucket for you..."
add_bucket 'main'
exit
}
$commands = commands
if ('--version' -contains $cmd -or (!$cmd -and '-v' -contains $args)) {
Push-Location $(versiondir 'scoop' 'current')
write-host "Current Scoop version:"
Invoke-Expression "git --no-pager log --oneline HEAD -n 1"
write-host ""
Pop-Location
Get-LocalBucket | ForEach-Object {
Push-Location (Find-BucketDirectory $_ -Root)
if(test-path '.git') {
write-host "'$_' bucket:"
Invoke-Expression "git --no-pager log --oneline HEAD -n 1"
write-host ""
}
Pop-Location
}
}
elseif (@($null, '--help', '/?') -contains $cmd -or $args[0] -contains '-h') { exec 'help' $args }
elseif ($commands -contains $cmd) { exec $cmd $args }
else { "scoop: '$cmd' isn't a scoop command. See 'scoop help'."; exit 1 }