From a803d4f6465e5fb19f8640ce0ec07105bbf6cb57 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 19 Aug 2015 10:57:42 -0400 Subject: [PATCH] Remove plugins manipulation commands Since we're now forcing users to rely on `npm` directly for updates, we can also get rid of plugin commands that attempt to install/update/remove using npm programatically and require users to use `npm` directly as well. This commit removes the following commands: - `plugins` - `plugin install` - `plugin update` - `plugin remove` Despite plugin related commands being removed, *the functionality that scans for plugins and registers them remains intact*. --- build/actions/index.js | 3 +- build/app.js | 8 --- build/plugins.js | 16 ------ lib/actions/index.coffee | 1 - lib/actions/plugin.coffee | 110 -------------------------------------- lib/app.coffee | 6 --- lib/plugins.coffee | 12 ----- 7 files changed, 1 insertion(+), 155 deletions(-) delete mode 100644 lib/actions/plugin.coffee diff --git a/build/actions/index.js b/build/actions/index.js index 5bd889e3..3558dce0 100644 --- a/build/actions/index.js +++ b/build/actions/index.js @@ -9,8 +9,7 @@ keys: require('./keys'), logs: require('./logs'), notes: require('./notes'), - help: require('./help'), - plugin: require('./plugin') + help: require('./help') }; }).call(this); diff --git a/build/app.js b/build/app.js index 424a5f6e..b65de5c3 100644 --- a/build/app.js +++ b/build/app.js @@ -94,14 +94,6 @@ capitano.command(actions.logs); - capitano.command(actions.plugin.list); - - capitano.command(actions.plugin.install); - - capitano.command(actions.plugin.update); - - capitano.command(actions.plugin.remove); - update.notify(); async.waterfall([ diff --git a/build/plugins.js b/build/plugins.js index 194666c6..da7f6534 100644 --- a/build/plugins.js +++ b/build/plugins.js @@ -36,20 +36,4 @@ }); }; - exports.list = function() { - return nplugm.list.apply(nplugm, arguments); - }; - - exports.install = function() { - return nplugm.install.apply(nplugm, arguments); - }; - - exports.update = function() { - return nplugm.update.apply(nplugm, arguments); - }; - - exports.remove = function() { - return nplugm.remove.apply(nplugm, arguments); - }; - }).call(this); diff --git a/lib/actions/index.coffee b/lib/actions/index.coffee index f028a9d3..11c579bb 100644 --- a/lib/actions/index.coffee +++ b/lib/actions/index.coffee @@ -9,4 +9,3 @@ module.exports = logs: require('./logs') notes: require('./notes') help: require('./help') - plugin: require('./plugin') diff --git a/lib/actions/plugin.coffee b/lib/actions/plugin.coffee deleted file mode 100644 index 69e2139c..00000000 --- a/lib/actions/plugin.coffee +++ /dev/null @@ -1,110 +0,0 @@ -_ = require('lodash') -visuals = require('resin-cli-visuals') -commandOptions = require('./command-options') -plugins = require('../plugins') -form = require('resin-cli-form') -async = require('async') - -exports.list = - signature: 'plugins' - description: 'list all plugins' - help: ''' - Use this command to list all the installed resin plugins. - - Examples: - - $ resin plugins - ''' - permission: 'user' - action: (params, options, done) -> - plugins.list (error, resinPlugins) -> - return done(error) if error? - - if _.isEmpty(resinPlugins) - console.log('You don\'t have any plugins yet') - return done() - - console.log visuals.table.horizontal resinPlugins, [ - 'name' - 'version' - 'description' - 'license' - ] - - return done() - -exports.install = - signature: 'plugin install ' - description: 'install a plugin' - help: ''' - Use this command to install a resin plugin - - Use `--quiet` to prevent information logging. - - Examples: - - $ resin plugin install hello - ''' - permission: 'user' - action: (params, options, done) -> - plugins.install params.name, (error) -> - return done(error) if error? - console.info("Plugin installed: #{params.name}") - return done() - -exports.update = - signature: 'plugin update ' - description: 'update a plugin' - help: ''' - Use this command to update a resin plugin - - Use `--quiet` to prevent information logging. - - Examples: - - $ resin plugin update hello - ''' - permission: 'user' - action: (params, options, done) -> - plugins.update params.name, (error, version) -> - return done(error) if error? - console.info("Plugin updated: #{params.name}@#{version}") - return done() - -exports.remove = - signature: 'plugin rm ' - description: 'remove a plugin' - help: ''' - Use this command to remove a resin.io plugin. - - Notice this command asks for confirmation interactively. - You can avoid this by passing the `--yes` boolean option. - - Examples: - - $ resin plugin rm hello - $ resin plugin rm hello --yes - ''' - options: [ commandOptions.yes ] - permission: 'user' - action: (params, options, done) -> - async.waterfall [ - - (callback) -> - if options.yes - return callback(null, true) - else - form.ask - message: 'Are you sure you want to delete the plugin?' - type: 'confirm' - default: false - .nodeify(callback) - - (confirmed, callback) -> - return callback() if not confirmed - plugins.remove(params.name, callback) - , (error) -> - return done(error) if error? - console.info("Plugin removed: #{params.name}") - return done() - ] diff --git a/lib/app.coffee b/lib/app.coffee index 7895fae4..e0c0bcab 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -68,12 +68,6 @@ capitano.command(actions.env.remove) # ---------- Logs Module ---------- capitano.command(actions.logs) -# ---------- Plugins Module ---------- -capitano.command(actions.plugin.list) -capitano.command(actions.plugin.install) -capitano.command(actions.plugin.update) -capitano.command(actions.plugin.remove) - update.notify() async.waterfall([ diff --git a/lib/plugins.coffee b/lib/plugins.coffee index d2f51d2b..b1acd9d5 100644 --- a/lib/plugins.coffee +++ b/lib/plugins.coffee @@ -20,15 +20,3 @@ exports.register = (prefix, callback) -> console.error(error.message) return callback() - -exports.list = -> - nplugm.list.apply(nplugm, arguments) - -exports.install = -> - nplugm.install.apply(nplugm, arguments) - -exports.update = -> - nplugm.update.apply(nplugm, arguments) - -exports.remove = -> - nplugm.remove.apply(nplugm, arguments)