Support --output option

This commit is contained in:
Juan Cruz Viotti 2014-12-02 11:53:34 -04:00
parent 7ea4ef84b4
commit 2b5d95af3a
2 changed files with 6 additions and 2 deletions

View File

@ -13,14 +13,14 @@ exports.download = (id) ->
wifiKey: resin.cli.getArgument('wifiKey')
fileName = resin.os.generateCacheName(id, params)
outputFile = path.join(resin.config.osDirectory, fileName)
outputFile = resin.cli.getArgument('output') or path.join(resin.config.osDirectory, fileName)
async.waterfall [
(callback) ->
# We need to ensure this directory exists
mkdirp resin.config.osDirectory, (error) ->
mkdirp path.dirname(outputFile), (error) ->
return callback(error)
(callback) ->

View File

@ -50,6 +50,10 @@ resin.cli.addOption
option: '-k, --wifi-key <wifiKey>'
description: 'wifi key, if network is wifi'
resin.cli.addOption
option: '-o, --output <output>'
description: 'output file'
# ---------- Auth Module ----------
resin.cli.addCommand
command: 'login [username:password]'