Skip to content

Commit

Permalink
change package.json parse error reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
gradus authored and indexzero committed Jul 10, 2012
1 parent 619c76b commit bfb0a05
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/jitsu/package.js
Expand Up @@ -57,6 +57,11 @@ package.get = function (dir, options, callback) {

package.read(dir, function (err, pkg) {
if (err) {
if (err.toString() === "Error: Invalid package.json file") {
jitsu.log.error(err.toString())
jitsu.log.error('Please make sure ' + (path.join(dir, '/package.json')).grey + ' is valid JSON');
return false;
}
return package.create(dir, callback);
}

Expand Down Expand Up @@ -128,7 +133,7 @@ package.create = function (dir, callback) {
'to select a default value, press ENTER'
];

jitsu.log.warn('There in no valid package.json file in ' + dir.grey);
jitsu.log.warn('There is no package.json file in ' + dir.grey);
jitsu.log.warn('Creating package.json at ' + (path.join(dir, '/package.json')).grey);

help.forEach(function (line) {
Expand Down

0 comments on commit bfb0a05

Please sign in to comment.