mirror of
https://github.com/bower/bower.git
synced 2026-02-11 22:44:58 -05:00
Add lookup command, minor tweaks to the info command.
This commit is contained in:
@@ -423,7 +423,7 @@ Manager.prototype._dissect = function () {
|
||||
|
||||
// Sort semver ones DESC
|
||||
semvers.sort(function (first, second) {
|
||||
return semver.rcompare(first, second);
|
||||
return semver.rcompare(first.pkgMeta.version, second.pkgMeta.version);
|
||||
});
|
||||
|
||||
// Filter non-semver ones
|
||||
|
||||
@@ -217,6 +217,7 @@ Project.prototype.uninstall = function (names, options) {
|
||||
.then(function () {
|
||||
var message;
|
||||
var data;
|
||||
var dependantsNames;
|
||||
var dependants = [];
|
||||
|
||||
// Walk the down the tree, gathering dependants of the package
|
||||
@@ -226,6 +227,9 @@ Project.prototype.uninstall = function (names, options) {
|
||||
}
|
||||
}, true);
|
||||
|
||||
// Remove duplicates
|
||||
dependants = mout.array.unique(dependants);
|
||||
|
||||
// Note that the root is filtered from the dependants
|
||||
// as well as other dependants marked to be uninstalled
|
||||
dependants = dependants.filter(function (dependant) {
|
||||
@@ -241,12 +245,20 @@ Project.prototype.uninstall = function (names, options) {
|
||||
|
||||
// Otherwise we need to figure it out if the user really wants to remove it,
|
||||
// even with dependants
|
||||
message = dependants.map(function (dep) { return dep.name; }).join(', ') + ' depends on ' + decEndpoint.name;
|
||||
// As such we need to prompt the user with a meaningful message
|
||||
dependantsNames = dependants
|
||||
.map(function (dep) {
|
||||
return dep.name;
|
||||
})
|
||||
.sort(function (name1, name2) {
|
||||
return name1.localeCompare(name2);
|
||||
});
|
||||
|
||||
dependantsNames = mout.array.unique(dependantsNames);
|
||||
message = dependantsNames.join(', ') + ' depends on ' + decEndpoint.name;
|
||||
data = {
|
||||
name: decEndpoint.name,
|
||||
dependants: dependants.map(function (decEndpoint) {
|
||||
return decEndpoint.name;
|
||||
})
|
||||
dependants: dependants
|
||||
};
|
||||
|
||||
// If interactive is disabled, error out
|
||||
|
||||
Reference in New Issue
Block a user