Permalink
Browse files

change package.json parse error reporting

  • Loading branch information...
gradus authored and indexzero committed May 8, 2012
1 parent 619c76b commit bfb0a0521ba82cb89cb555bd836985301d91337b
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/jitsu/package.js
View
@@ -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);
}
@@ -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) {

0 comments on commit bfb0a05

Please sign in to comment.