Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

change package.json parse error reporting

  • Loading branch information...
commit bfb0a0521ba82cb89cb555bd836985301d91337b 1 parent 619c76b
@gradus gradus authored indexzero committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/jitsu/package.js
View
7 lib/jitsu/package.js
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.