forked from ScoopInstaller/Scoop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(update): Add hold/unhold command (ScoopInstaller#3444)
Allows un/locking a program to the current version and enable/disable updates. Close ScoopInstaller#3232 Close ScoopInstaller#1941
- Loading branch information
Showing
6 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Usage: scoop hold <apps> | ||
# Summary: Hold an app to disable updates | ||
|
||
. "$psscriptroot\..\lib\help.ps1" | ||
. "$psscriptroot\..\lib\manifest.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 | ||
} | ||
|
||
$dir = versiondir $app 'current' $global | ||
$json = install_info $app 'current' $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 locked and can not be updated anymore." | ||
} | ||
|
||
exit $exitcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Usage: scoop unhold <app> | ||
# Summary: Unhold an app to enable updates | ||
|
||
. "$psscriptroot\..\lib\help.ps1" | ||
. "$psscriptroot\..\lib\manifest.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 | ||
} | ||
|
||
$dir = versiondir $app 'current' $global | ||
$json = install_info $app 'current' $global | ||
$install = @{} | ||
$json | Get-Member -MemberType Properties | ForEach-Object { $install.Add($_.Name, $json.($_.Name))} | ||
$install.hold = $null | ||
save_install_info $install $dir | ||
success "$app is now unlocked and can be updated again." | ||
} | ||
|
||
exit $exitcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters