Permalink
Browse files

[fix] layout

  • Loading branch information...
1 parent f45754f commit 0554f9ce41c0f86f1b2023f5ebb8407d452c07d8 @yawnt yawnt committed Sep 18, 2012
View
Binary file not shown.
View
Binary file not shown.
View
@@ -15,6 +15,7 @@ var fs = require('fs'),
analyzer = require('require-analyzer'),
semver = require('semver'),
jitsu = require('../jitsu'),
+ ladder = require('ladder'),
fstream = require('fstream'),
fstreamNpm = require('fstream-npm'),
tar = require('tar');
@@ -292,10 +293,15 @@ package.write = function (pkg, dir, create, callback) {
if (!result) {
return create ? package.create(dir, callback) : callback(new Error('Save package.json cancelled.'));
}
-
- fs.writeFile(path.join(dir, 'package.json'), JSON.stringify(pkg, null, 2), function (err) {
- return err ? callback(err) : callback(null, pkg, dir);
+
+ fs.readFile(path.resolve(path.join(dir, 'package.json')), function(e, data) {
+ var offset = ladder(data.toString());
+
+ fs.writeFile(path.join(dir, 'package.json'), JSON.stringify(pkg, null, offset || 2), function (err) {
+ return err ? callback(err) : callback(null, pkg, dir);
+ });
});
+
});
};
View
@@ -36,7 +36,8 @@
"spawn-command": "0.0.1",
"semver": "1.0.14",
"tar": "0.1.13",
- "wizard": "0.0.1"
+ "wizard": "0.0.1",
+ "ladder": "0.0.0"
},
"devDependencies": {
"nock": "0.8.x",
@@ -4,7 +4,7 @@
"scripts": {
"start": "server.js"
},
- "version": "0.0.0-2",
+ "version": "0.0.0-1",
"engines": {
"node": "0.6.x"
}
@@ -4,5 +4,7 @@
"userconfig": ".jitsuconf",
"loglevel": "silly",
"tar": "tar",
- "gzipbin": "gzip"
-}
+ "gzipbin": "gzip",
+ "username": "tester",
+ "password": "EXAMPLE-PASSWORD"
+}

0 comments on commit 0554f9c

Please sign in to comment.