Skip to content

Commit

Permalink
Auto-sort bower.json dependencies alphabetically, fixes #1373
Browse files Browse the repository at this point in the history
  • Loading branch information
insanehong committed Mar 6, 2015
1 parent 182d92f commit 91bc64c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/core/Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ var createError = require('../util/createError');
var readJson = require('../util/readJson');
var validLink = require('../util/validLink');
var scripts = require('./scripts');
var sortobject = require('deep-sort-object');

function Project(config, logger) {
// This is the only architecture component that ensures defaults
Expand Down Expand Up @@ -98,11 +99,11 @@ Project.prototype.install = function (decEndpoints, options, config) {
}

if (that._options.save) {
that._json.dependencies = mout.object.mixIn(that._json.dependencies || {}, jsonEndpoint);
that._json.dependencies = sortobject(mout.object.mixIn(that._json.dependencies || {}, jsonEndpoint));
}

if (that._options.saveDev) {
that._json.devDependencies = mout.object.mixIn(that._json.devDependencies || {}, jsonEndpoint);
that._json.devDependencies = sortobject(mout.object.mixIn(that._json.devDependencies || {}, jsonEndpoint));
}
});
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"chalk": "^1.0.0",
"chmodr": "0.1.0",
"decompress-zip": "^0.1.0",
"deep-sort-object": "~0.1.1",
"fstream": "^1.0.3",
"fstream-ignore": "^1.0.2",
"glob": "^4.3.2",
Expand Down

0 comments on commit 91bc64c

Please sign in to comment.