Skip to content

Commit

Permalink
[fix] toString
Browse files Browse the repository at this point in the history
  • Loading branch information
yawnt committed Sep 25, 2012
1 parent 1e6243e commit e5f893f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/jitsu/package.js
Expand Up @@ -295,9 +295,9 @@ package.write = function (pkg, dir, create, callback) {
}

fs.readFile(path.resolve(path.join(dir, 'package.json')), function(e, data) {
var offset = ladder(data.toString());
var offset = data ? ladder(data.toString()) : 2;

fs.writeFile(path.join(dir, 'package.json'), JSON.stringify(pkg, null, offset || 2), function (err) {
fs.writeFile(path.join(dir, 'package.json'), JSON.stringify(pkg, null, offset), function (err) {
return err ? callback(err) : callback(null, pkg, dir);
});
});
Expand Down

0 comments on commit e5f893f

Please sign in to comment.