Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(scoop-update): Add support for pre_uninstall and post_uninstall #5085

Merged
merged 2 commits into from
Aug 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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