From 2782acf4383e350bccd5695a4b75aca4f6c04d4c Mon Sep 17 00:00:00 2001 From: Subramanian Venkatesan Date: Mon, 10 Sep 2018 18:25:17 +0530 Subject: [PATCH] fix plugin command --- lib/modules/plugin_cmd/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/modules/plugin_cmd/index.js b/lib/modules/plugin_cmd/index.js index 6487dda1f..92808df6a 100644 --- a/lib/modules/plugin_cmd/index.js +++ b/lib/modules/plugin_cmd/index.js @@ -6,9 +6,9 @@ class PluginCommand { this.embark = embark; this.config = config; this.embarkConfig = fs.readJSONSync(this.config.embarkConfigFile); - this.registerCommands(); + this.registerCommand(); } - registerCommands() { + registerCommand() { const self = this; self.embark.registerConsoleCommand((cmd, _options) => { let cmdArray = cmd.split(' '); @@ -18,12 +18,12 @@ class PluginCommand { match: () => cmdName === 'plugin', process: (callback) => { if(cmdArray.length < 3 || cmdArray[1] !== 'install' || typeof cmdArray[2] === 'undefined') { - return callback(__('arguments to the command are missing or invalid')); + return callback('invalid use of plugin command. Please use plugin install '); } let npmInstall = ['npm', 'install']; if (cmdArray[2] === '--save') { if(typeof cmdArray[3] === 'undefined') { - return callback(__('npm package argument missing')); + return callback('package argument missing'); } } else { npmInstall.push('--save'); @@ -50,7 +50,7 @@ class PluginCommand { } ], (err) => { if(err) { - callback(__(err)); + callback(err); } else { callback(null, 'npm package successfully installed as a plugin'); }