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 Jul 17, 2014
1 parent a5074ec commit 1aa0cf2
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 @@ -88,11 +89,11 @@ Project.prototype.install = function (decEndpoints, options, config) {
jsonEndpoint = endpointParser.decomposed2json(decEndpoint);

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": "~0.5.0",
"chmodr": "~0.1.0",
"decompress-zip": "0.0.6",
"deep-sort-object": "~0.1.1",
"fstream": "~0.1.22",
"fstream-ignore": "0.0.6",
"glob": "~4.0.2",
Expand Down

0 comments on commit 1aa0cf2

Please sign in to comment.