From 7695a4c1b0efc2b5b5a6a2eefddd8b4e36c49af0 Mon Sep 17 00:00:00 2001 From: RasPhilCo Date: Thu, 17 Dec 2020 10:59:27 -0800 Subject: [PATCH] fix: stop cli action & rethrow uninstall error (#200) --- src/commands/plugins/uninstall.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/commands/plugins/uninstall.ts b/src/commands/plugins/uninstall.ts index 4d4b0419..f9bdc47b 100644 --- a/src/commands/plugins/uninstall.ts +++ b/src/commands/plugins/uninstall.ts @@ -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' @@ -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() } }