Comparing version 0.5.0 to 0.5.1
@@ -7,2 +7,6 @@ const moment = require('moment-timezone'); | ||
exports.printError = function (message) { | ||
console.log(message); | ||
}; | ||
exports.convertTimezone = function (time, timezone, callback) { | ||
@@ -9,0 +13,0 @@ if (moment.tz.zone(timezone)) { |
@@ -26,3 +26,4 @@ const axios = require('axios'); | ||
timezoneError = true; | ||
return helpers.printMessage(chalk.red(error)); | ||
let errorMessage = chalk.red('error: ' + error); | ||
return helpers.printError(errorMessage); | ||
}); | ||
@@ -70,3 +71,7 @@ } | ||
} | ||
}).catch(function (error) { | ||
let errorData = error.response.data; | ||
let errorMessage = chalk.red(errorData.status + ': ' + errorData.msg); | ||
helpers.printError(errorMessage); | ||
}); | ||
}; |
{ | ||
"name": "space-cli", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "CLI for space information", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -20,5 +20,5 @@ # Space CLI | ||
**Example commands:** | ||
`space next` - show id, name and time (scheduled attempted) of the next rocket launch | ||
`space next -d -tz Asia/Shanghai` - show id, name, time (scheduled attempted) converted to CST time zone, available live stream options and name of the rocket | ||
`space next` - shows id, launch name, time (scheduled attempted) and available live stream options for the next rocket launch | ||
`space next -d --tz Asia/Shanghai --lt 5` - shows id, launch name, time (scheduled attempted) converted to CST time zone, name of a rocket, and missions (with type and description) for the next 5 launches | ||
Space CLI is in active development, to see currently available commands and options, use `space -h`. |
7079
107