Remove selfupdate functionality

We added this because we thought that knowledge of the supported device types, along with the configuration procedures was going to be encoded in the CLI.

With device specs, this is not longer the case.
This commit is contained in:
Juan Cruz Viotti 2015-08-03 12:16:02 -04:00
parent f220e380a7
commit d423a6ea24
8 changed files with 3 additions and 94 deletions

View File

@ -12,8 +12,7 @@
preferences: require('./preferences'),
help: require('./help'),
examples: require('./examples'),
plugin: require('./plugin'),
update: require('./update')
plugin: require('./plugin')
};
}).call(this);

View File

@ -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;

View File

@ -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);

View File

@ -12,4 +12,3 @@ module.exports =
help: require('./help')
examples: require('./examples')
plugin: require('./plugin')
update: require('./update')

View File

@ -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()

View File

@ -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)

View File

@ -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()

View File

@ -73,7 +73,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"
}
}