Comparing version 1.0.2 to 1.0.3
@@ -71,8 +71,6 @@ var Cli = require('nested-yargs'); | ||
nbf: { | ||
description: 'webtask cannot be used before this time (use +N to indicate \'N\' minutes from now)', | ||
type: 'string', | ||
description: 'webtask cannot be used before this time', | ||
}, | ||
exp: { | ||
description: 'webtask cannot be used after this time (use +N to indicate \'N\' minutes from now)', | ||
type: 'string', | ||
description: 'webtask cannot be used after this time', | ||
}, | ||
@@ -187,3 +185,3 @@ 'self-revoke': { | ||
} | ||
else if (argv.name && argv.output !== 'none') { | ||
else if (argv.name) { | ||
throw new Error('The `name` option can only be specified when --output is set to `url`.'); | ||
@@ -255,4 +253,3 @@ } | ||
webtask_url: profile.url + '/api/run/' | ||
+ (argv.container || profile.container) | ||
+ '?key=' + token | ||
+ profile.container + '?key=' + token | ||
+ (argv.prod ? '': '&webtask_no_cache=1') | ||
@@ -263,3 +260,3 @@ }; | ||
+ '/api/run/' | ||
+ (argv.container || profile.container) | ||
+ profile.container | ||
+ '/' + argv.name | ||
@@ -298,3 +295,3 @@ + (argv.prod ? '': '?webtask_no_cache=1'); | ||
var date = (value[0] === '+') | ||
? new Date(Date.now() + parseInt(value.substring(1), 10) * 60 * 1000) | ||
? Date.now() + parseInt(value.substring(1), 10) * 60 * 1000 | ||
: Date.parse(value); | ||
@@ -301,0 +298,0 @@ |
var Bluebird = require('bluebird'); | ||
var Cli = require('nested-yargs'); | ||
var Create = require('./create'); | ||
var Cron = require('cron-parser'); | ||
var Webtask = require('../'); | ||
@@ -315,20 +314,6 @@ var _ = require('lodash'); | ||
if (job.results.length) { | ||
console.log('Last result: '.blue, job.results[0].type); | ||
console.log('Last run at: '.blue, new Date(job.results[0].created_at).toLocaleString()); | ||
if (job.last_result) { | ||
console.log('Last result: '.blue, job.last_result.type); | ||
console.log('Last run at: '.blue, new Date(job.last_result.created_at).toLocaleString()); | ||
} | ||
var intervalOptions = { | ||
currentDate: new Date(job.next_available_at), | ||
}; | ||
if (job.expires_at) { | ||
intervalOptions.endDate = new Date(job.expires_at); | ||
} | ||
console.log('Next run: '.blue, new Date(job.next_available_at).toLocaleString()); | ||
if (job.expires_at) { | ||
console.log('Expires: '.blue, new Date(job.expires_at).toLocaleString()); | ||
} | ||
} | ||
@@ -335,0 +320,0 @@ |
@@ -19,12 +19,2 @@ var Bluebird = require('bluebird'); | ||
}, | ||
all: { | ||
alias: 'a', | ||
description: 'show cluster logs', | ||
type: 'boolean', | ||
}, | ||
verbose: { | ||
alias: 'v', | ||
description: 'show verbose logs', | ||
type: 'boolean', | ||
}, | ||
profile: { | ||
@@ -78,3 +68,3 @@ alias: 'p', | ||
.spread(function (profile, stream) { | ||
logger.info({ container: argv.container || profile.container }, | ||
logger.info({ container: profile.container }, | ||
'connected to streaming logs'); | ||
@@ -94,8 +84,6 @@ | ||
if (!data || (data.name !== 'sandbox-kafka' && !argv.all)) | ||
return; | ||
if (!data || data.name !== 'sandbox-kafka') return; | ||
if (argv.raw) console.log(data.msg); | ||
else if (typeof data === 'string') logger.info(data); | ||
else if (argv.verbose) logger.info(data, data.msg); | ||
else logger.info(data.msg); | ||
@@ -102,0 +90,0 @@ } |
@@ -146,3 +146,3 @@ var Bluebird = require('bluebird'); | ||
+ '$ echo "module.exports = function (cb) { cb(null, \'Hello\'); }" > hello.js\n'.bold | ||
+ '$ wt create hello-world.js\n'.bold).green); | ||
+ '$ wt create hello.js\n'.bold).green); | ||
}); | ||
@@ -149,0 +149,0 @@ }) |
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Webtask Command Line Interface", | ||
@@ -11,0 +11,0 @@ "tags": [ |
@@ -22,4 +22,4 @@ /* express app as a webtask */ | ||
// DELETE | ||
app.delete('*', function (req, res) { | ||
// DEL | ||
app.del('*', function (req, res) { | ||
res.json({ id: 1 }) | ||
@@ -30,2 +30,2 @@ }); | ||
module.exports = Webtask.fromExpress(app); | ||
module.exports = Webtask.fromExpress(app); |
67241
1579