From 72d08ffbbf6b5fa4c82b13ad3c867e81485727da Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 15 Jan 2015 11:16:07 -0300 Subject: [PATCH] Move version action to actions/ --- lib/actions/index.coffee | 1 + lib/actions/info.coffee | 5 +++++ lib/app.coffee | 4 +--- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 lib/actions/info.coffee diff --git a/lib/actions/index.coffee b/lib/actions/index.coffee index 67ca6e24..50622b3f 100644 --- a/lib/actions/index.coffee +++ b/lib/actions/index.coffee @@ -1,5 +1,6 @@ module.exports = app: require('./app') + info: require('./info') auth: require('./auth') device: require('./device') env: require('./environment-variables') diff --git a/lib/actions/info.coffee b/lib/actions/info.coffee new file mode 100644 index 00000000..714bfffd --- /dev/null +++ b/lib/actions/info.coffee @@ -0,0 +1,5 @@ +packageJSON = require('../../package.json') +log = require('../log/log') + +exports.version = -> + log.out(packageJSON.version) diff --git a/lib/app.coffee b/lib/app.coffee index f52b2a69..da618304 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -2,7 +2,6 @@ _ = require('lodash') path = require('path') capitano = require('capitano') resin = require('resin-sdk') -packageJSON = require('../package.json') actions = require('./actions') log = require('./log/log') errors = require('./errors/errors') @@ -11,8 +10,7 @@ plugin = require('./plugin/plugin') capitano.command signature: 'version' description: 'output the version number' - action: -> - log.out(packageJSON.version) + action: actions.info.version capitano.command signature: 'help [command...]'