Skip to content

Commit

Permalink
fix: stop cli action & rethrow uninstall error (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
RasPhilCo committed Dec 17, 2020
1 parent 3c94143 commit 7695a4c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/commands/plugins/uninstall.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {Command, flags} from '@oclif/command'
import {Plugin} from '@oclif/config'
import chalk from 'chalk'
import cli from 'cli-ux'

import Plugins from '../../plugins'
Expand Down Expand Up @@ -46,7 +47,12 @@ export default class PluginsUninstall extends Command {
}
return this.error(`${friendly} is not installed`)
}
await this.plugins.uninstall(unfriendly.name)
try {
await this.plugins.uninstall(unfriendly.name)
} catch (error) {
cli.action.stop(chalk.bold.red('failed'))
throw error
}
cli.action.stop()
}
}
Expand Down

0 comments on commit 7695a4c

Please sign in to comment.