forked from ScoopInstaller/Scoop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scoop-hold.ps1
39 lines (32 loc) · 925 Bytes
/
scoop-hold.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
# Usage: scoop hold <apps>
# Summary: Hold an app to disable updates
. "$PSScriptRoot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\manifest.ps1"
. "$PSScriptRoot\..\lib\versions.ps1"
reset_aliases
$apps = $args
if(!$apps) {
my_usage
exit 1
}
$apps | ForEach-Object {
$app = $_
$global = installed $app $true
if (!(installed $app)) {
error "'$app' is not installed."
return
}
if (get_config NO_JUNCTIONS) {
$version = Select-CurrentVersion -App $app -Global:$global
} else {
$version = 'current'
}
$dir = versiondir $app $version $global
$json = install_info $app $version $global
$install = @{}
$json | Get-Member -MemberType Properties | ForEach-Object { $install.Add($_.Name, $json.($_.Name))}
$install.hold = $true
save_install_info $install $dir
success "$app is now held and can not be updated anymore."
}
exit $exitcode