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 Jan 8, 2015
1 parent a04b69d commit f62aaa5
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
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 @@ -94,11 +95,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
Expand Up @@ -27,6 +27,7 @@
"chalk": "0.5.1",
"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 f62aaa5

Please sign in to comment.