balena-cli/lib/actions/update.coffee
2015-03-11 08:49:26 -04:00

27 lines
715 B
CoffeeScript

npm = require('../npm')
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) ->
npm.update packageJSON.name, (error, version) ->
return done(error) if error?
console.info("Upgraded #{packageJSON.name} to v#{version}.")
return done(null, version)