Skip to content

Commit

Permalink
Check version for min
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoberger committed Mar 9, 2017
1 parent acbeece commit 7e53a6e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ exports.run = function(config, info) {
console.log('');
console.log('To see what you can do with your API, type ' + 'oai help'.yellow + '.');
console.log('');
console.log('To publish your OAI file, type ' + 'oai host'.yellow + '!');
console.log('');

process.exit();
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "ReadMe <[email protected]> (http://readme.io)",
"name": "api",
"description": "A collection of API tools",
"name": "oai",
"description": "A collection of Open API Initiative (Swagger) tools",
"bin": {
"api": "index.js"
},
Expand All @@ -10,6 +10,7 @@
"apis",
"swagger",
"open api initiative",
"oai",
"apidoc",
"microservice"
],
Expand Down
7 changes: 6 additions & 1 deletion utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ exports.fileExists = function(file) {

exports.getSwaggerUrl = function(config, info, cb) {
var status = exports.uploadAnimation();
// TODO! Make them log in to upload

var user = jsonfile.readFileSync(config.apiFile);

Expand All @@ -151,6 +150,7 @@ exports.getSwaggerUrl = function(config, info, cb) {
'swagger': JSON.stringify(info.swagger),
'cli': 1,
'user': user.token,
'cli-tool-version': require('./package.json').version,
}
}, function(err, res, url) {
if (!res) {
Expand All @@ -170,6 +170,11 @@ exports.getSwaggerUrl = function(config, info, cb) {
return process.exit();
}

if (res.headers.warning) {
console.log("");
console.log("Warning! ".yellow + res.headers.warning.yellow);
}

cb(url);

});
Expand Down

0 comments on commit 7e53a6e

Please sign in to comment.