mirror of
https://github.com/balena-io/balena-cli.git
synced 2025-01-18 10:46:34 +00:00
Merge pull request #131 from resin-io/remove/selfupdate
Remove selfupdate functionality
This commit is contained in:
commit
d24b871964
@ -12,8 +12,7 @@
|
||||
preferences: require('./preferences'),
|
||||
help: require('./help'),
|
||||
examples: require('./examples'),
|
||||
plugin: require('./plugin'),
|
||||
update: require('./update')
|
||||
plugin: require('./plugin')
|
||||
};
|
||||
|
||||
}).call(this);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
@ -12,4 +12,3 @@ module.exports =
|
||||
help: require('./help')
|
||||
examples: require('./examples')
|
||||
plugin: require('./plugin')
|
||||
update: require('./update')
|
||||
|
@ -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()
|
@ -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)
|
||||
|
||||
|
@ -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()
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user