From acbeeceb2f7c6175c4aca16a36da4a8ff3b03ac3 Mon Sep 17 00:00:00 2001 From: Gregory Koberger Date: Wed, 8 Mar 2017 23:32:42 -0800 Subject: [PATCH] Fix the auto-add ID stuff --- api.js | 4 ++-- utils.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api.js b/api.js index f5d9c390c..65c60d901 100644 --- a/api.js +++ b/api.js @@ -50,7 +50,7 @@ exports.api = function(args, opts) { if(add.trim()[0] != 'y') { console.log(""); console.log("Okay! To do it yourself, edit "+file.split('/').slice(-1)[0].yellow+" and add the following 'x-api-id' line:"); - exampleId(apiId, file); + exampleId(file, apiId); console.log(""); console.log("Make sure you commit the changes so your team is all using the same ID."); @@ -65,7 +65,7 @@ exports.api = function(args, opts) { } else { console.log("We weren't able to add the ID automatically. In "+file.split('/').slice(-1)[0].yellow+", add the following 'x-api-id' line:"); - exampleId(apiId, file); + exampleId(file, apiId); console.log("Make sure you commit the changes so your team is all using the same ID."); diff --git a/utils.js b/utils.js index a74bfcfe3..478d15c28 100644 --- a/utils.js +++ b/utils.js @@ -117,7 +117,7 @@ exports.addId = function(file, id) { if(file.match(/json$/)) { try { - JSON.parse(content); + JSON.parse(contents); } catch(e) { return false; }