2015-05-13 18:37:27 +00:00
|
|
|
selfupdate = require('selfupdate')
|
2015-03-04 18:03:08 +00:00
|
|
|
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.
|
|
|
|
|
2015-03-04 18:47:46 +00:00
|
|
|
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.
|
|
|
|
|
2015-03-04 18:03:08 +00:00
|
|
|
Examples:
|
|
|
|
|
|
|
|
$ resin update
|
|
|
|
'''
|
|
|
|
action: (params, options, done) ->
|
2015-05-13 18:37:27 +00:00
|
|
|
selfupdate.update packageJSON, (error, version) ->
|
2015-03-11 12:49:26 +00:00
|
|
|
return done(error) if error?
|
2015-05-13 18:37:27 +00:00
|
|
|
console.info("Updated #{packageJSON.name} to version #{version}.")
|
|
|
|
return done()
|