Skip to content

Commit

Permalink
fix: dont run postrun hook for uinstalled plugins (#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Oct 5, 2023
1 parent 8cb699c commit 0c47a5c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,13 @@ export class Config implements IConfig {
await this.runHook('prerun', {Command: command, argv})

const result = (await command.run(argv, this)) as T
// If plugins:uninstall was run, we need to remove all the uninstalled plugins
// from this.plugins so that the postrun hook doesn't attempt to run any
// hooks that might have existed in the uninstalled plugins.
if (c.id === 'plugins:uninstall') {
for (const arg of argv) this.plugins.delete(arg)
}

await this.runHook('postrun', {Command: command, argv, result})

marker?.addDetails({command: id, plugin: c.pluginName!})
Expand Down

0 comments on commit 0c47a5c

Please sign in to comment.