Skip to content

Commit

Permalink
feat(scoop-update): Add support for pre_uninstall and `post_uninsta…
Browse files Browse the repository at this point in the history
  • Loading branch information
yi-Xu-0100 committed Aug 6, 2022
1 parent ca19d7b commit 7bfef49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- **core:** Improve argument concatenation in `Invoke-ExternalCommand` ([#5065](https://github.com/ScoopInstaller/Scoop/issues/5065))
- **install:** Show bucket name while installing an app ([#5075](https://github.com/ScoopInstaller/Scoop/issues/5075))
- **scoop-status:** Add flag to disable remote checking ([#5073](https://github.com/ScoopInstaller/Scoop/issues/5073))
- **scoop-update:** Add support for `pre_uninstall` and `post_uninstall` ([#5085](https://github.com/ScoopInstaller/Scoop/issues/5085))

### Bug Fixes

Expand Down
4 changes: 4 additions & 0 deletions libexec/scoop-update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ function update($app, $global, $quiet = $false, $independent, $suggested, $use_c
$dir = versiondir $app $old_version $global
$persist_dir = persistdir $app $global

Invoke-HookScript -HookType 'pre_uninstall' -Manifest $old_manifest -Arch $architecture

#region Workaround for #2952
if (test_running_process $app $global) {
return
Expand Down Expand Up @@ -272,6 +274,8 @@ function update($app, $global, $quiet = $false, $independent, $suggested, $use_c
}
}

Invoke-HookScript -HookType 'post_uninstall' -Manifest $old_manifest -Arch $architecture

if ($bucket) {
# add bucket name it was installed from
$app = "$bucket/$app"
Expand Down

0 comments on commit 7bfef49

Please sign in to comment.