Skip to content

Commit

Permalink
fix: reinstall plugin from url if applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Mar 21, 2024
1 parent 7c33ba1 commit a127059
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/commands/plugins/reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export default class Reset extends Command {
}

await Promise.all(filesToDelete.map((file) => rm(file, {force: true, recursive: true})))

for (const plugin of userPlugins) {
this.log(`✅ ${plugin.type === 'link' ? 'Unlinked' : 'Uninstalled'} ${plugin.name}`)
}
Expand Down Expand Up @@ -78,7 +77,9 @@ export default class Reset extends Command {

if (plugin.type === 'user') {
try {
const newPlugin = await plugins.install(plugin.name, {tag: plugin.tag})
const newPlugin = plugin.url
? await plugins.install(plugin.url)
: await plugins.install(plugin.name, {tag: plugin.tag})
const newVersion = chalk.dim(`-> ${newPlugin.version}`)
const tag = plugin.tag ? `@${plugin.tag}` : plugin.url ? ` (${plugin.url})` : ''
this.log(`✅ Reinstalled ${plugin.name}${tag} ${newVersion}`)
Expand Down

0 comments on commit a127059

Please sign in to comment.