-
Notifications
You must be signed in to change notification settings - Fork 22
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
W-12465784 feat: add plugins:post
* hooks
#932
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ export default class PluginsUninstall extends Command { | |
logLevel: determineLogLevel(this.config, flags, 'silent'), | ||
}) | ||
|
||
const pluginNameToDelete: string[] = [] | ||
|
||
if (argv.length === 0) argv.push('.') | ||
for (const plugin of argv as string[]) { | ||
const friendly = removeTags(plugins.friendlyName(plugin)) | ||
|
@@ -64,15 +66,22 @@ export default class PluginsUninstall extends Command { | |
|
||
try { | ||
const {name} = unfriendly | ||
const displayName = friendly === '.' ? name : friendly ?? name | ||
const displayName = friendly === '.' ? name : (friendly ?? name) | ||
ux.action.start(`${this.config.name}: Uninstalling ${displayName}`) | ||
await plugins.uninstall(name) | ||
pluginNameToDelete.push(name) | ||
} catch (error) { | ||
ux.action.stop(bold.red('failed')) | ||
throw error | ||
} | ||
|
||
ux.action.stop() | ||
} | ||
|
||
for (const p of pluginNameToDelete) { | ||
this.config.plugins.delete(p) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know we do the same here: but for the autocomplete refresh-hook use-case it doesn't work because the hook runs before oclif/core calls example with some logs to show order of execution
maybe we can remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I think we can safely remove that once this is merged |
||
|
||
await this.config.runHook('plugins:postuninstall', {}) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plugin-autocomplete needs
config.plugins
with the new plugin populated for it to be included in the refreshed autocomplete files:https://github.com/oclif/plugin-autocomplete/blob/986c6ec238ff3764c78331de7ea7b49e0670a47c/src/commands/autocomplete/create.ts#L95