diff --git a/build/actions/index.js b/build/actions/index.js index 96dd2b1b..f09ebe6b 100644 --- a/build/actions/index.js +++ b/build/actions/index.js @@ -12,8 +12,7 @@ preferences: require('./preferences'), help: require('./help'), examples: require('./examples'), - plugin: require('./plugin'), - update: require('./update') + plugin: require('./plugin') }; }).call(this); diff --git a/build/app.js b/build/app.js index 8c89c8c5..a10d91cf 100644 --- a/build/app.js +++ b/build/app.js @@ -1,5 +1,5 @@ (function() { - var _, actions, async, capitano, changeProjectDirectory, errors, plugins, resin, update; + var _, actions, async, capitano, changeProjectDirectory, errors, plugins, resin; _ = require('lodash'); @@ -15,8 +15,6 @@ plugins = require('./plugins'); - update = require('./update'); - capitano.permission('user', function(done) { return resin.auth.isLoggedIn().then(function(isLoggedIn) { if (!isLoggedIn) { @@ -143,8 +141,6 @@ capitano.command(actions.plugin.remove); - capitano.command(actions.update.update); - changeProjectDirectory = function(directory) { try { return process.chdir(directory); @@ -155,8 +151,6 @@ async.waterfall([ function(callback) { - return update.check(callback); - }, function(callback) { return plugins.register('resin-plugin-', callback); }, function(callback) { var cli; diff --git a/build/update.js b/build/update.js deleted file mode 100644 index 9bfef2c9..00000000 --- a/build/update.js +++ /dev/null @@ -1,30 +0,0 @@ -(function() { - var _, packageJSON, updateNotifier; - - updateNotifier = require('update-notifier'); - - _ = require('lodash'); - - _.str = require('underscore.string'); - - packageJSON = require('../package.json'); - - exports.notify = function(update) { - if (!process.stdout.isTTY) { - return; - } - return console.log("> " + (_.str.capitalize(update.type)) + " update available: " + update.current + " -> " + update.latest + "\n> Run:\n> $ resin update"); - }; - - exports.check = function(callback) { - var notifier; - notifier = updateNotifier({ - pkg: packageJSON - }); - if (notifier.update != null) { - exports.notify(notifier.update); - } - return callback(); - }; - -}).call(this); diff --git a/lib/actions/index.coffee b/lib/actions/index.coffee index eefdbf8b..eed70bb8 100644 --- a/lib/actions/index.coffee +++ b/lib/actions/index.coffee @@ -12,4 +12,3 @@ module.exports = help: require('./help') examples: require('./examples') plugin: require('./plugin') - update: require('./update') diff --git a/lib/actions/update.coffee b/lib/actions/update.coffee deleted file mode 100644 index a37d6946..00000000 --- a/lib/actions/update.coffee +++ /dev/null @@ -1,26 +0,0 @@ -selfupdate = require('selfupdate') -packageJSON = require('../../package.json') - -exports.update = - signature: 'update' - description: 'update the resin cli' - help: ''' - Use this command to update the Resin CLI - - This command outputs information about the update process. - Use `--quiet` to remove that output. - - The Resin CLI checks for updates once per day. - - Major updates require a manual update with this update command, - while minor updates are applied automatically. - - Examples: - - $ resin update - ''' - action: (params, options, done) -> - selfupdate.update packageJSON, (error, version) -> - return done(error) if error? - console.info("Updated #{packageJSON.name} to version #{version}.") - return done() diff --git a/lib/app.coffee b/lib/app.coffee index 1945d87d..936a37d2 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -5,7 +5,6 @@ resin = require('resin-sdk') actions = require('./actions') errors = require('./errors') plugins = require('./plugins') -update = require('./update') capitano.permission 'user', (done) -> resin.auth.isLoggedIn().then (isLoggedIn) -> @@ -112,9 +111,6 @@ capitano.command(actions.plugin.install) capitano.command(actions.plugin.update) capitano.command(actions.plugin.remove) -# ---------- Update Module ---------- -capitano.command(actions.update.update) - changeProjectDirectory = (directory) -> try process.chdir(directory) @@ -123,9 +119,6 @@ changeProjectDirectory = (directory) -> async.waterfall([ - (callback) -> - update.check(callback) - (callback) -> plugins.register('resin-plugin-', callback) diff --git a/lib/update.coffee b/lib/update.coffee deleted file mode 100644 index 6978ce35..00000000 --- a/lib/update.coffee +++ /dev/null @@ -1,19 +0,0 @@ -updateNotifier = require('update-notifier') -_ = require('lodash') -_.str = require('underscore.string') -packageJSON = require('../package.json') - -exports.notify = (update) -> - return if not process.stdout.isTTY - - console.log """ - > #{_.str.capitalize(update.type)} update available: #{update.current} -> #{update.latest} - > Run: - > $ resin update - """ - -exports.check = (callback) -> - notifier = updateNotifier(pkg: packageJSON) - if notifier.update? - exports.notify(notifier.update) - return callback() diff --git a/package.json b/package.json index f8dc2d1c..42d04422 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,6 @@ "selfupdate": "^1.1.0", "through2": "^2.0.0", "tmp": "0.0.26", - "underscore.string": "^3.1.1", - "update-notifier": "^0.5.0" + "underscore.string": "^3.1.1" } }