don't crash when removing a nonexistent package

This commit is contained in:
ekatek
2014-08-20 15:20:22 -07:00
parent 4ce2888596
commit 019d3d289e

View File

@@ -1757,12 +1757,9 @@ main.registerCommand({
maxArgs: Infinity,
requiresApp: true
}, function (options) {
// Refresh the catalog, checking the remote package data on the
// server. Technically, we don't need to do this, since it is unlikely that
// new data will change our constraint solver decisions. But as a user, I
// would expect this command to update the local catalog.
// XXX what if we're offline?
refreshOfficialCatalogOrDie();
// As user may expect this to update the catalog, but we con't actually need
// to, and it takes frustratingly long.
// refreshOfficialCatalogOrDie();
// Read in existing package dependencies.
var packages = project.getConstraints();
@@ -1786,8 +1783,9 @@ main.registerCommand({
var messages = buildmessage.capture(function () {
// Get the contents of our versions file, we will want them in order to
// remove to the user what we removed.
var versions = project.getVersions();
// remove to the user what we removed. Note that we are actually just getting
// getting the versions file, not running the constraint solver.
var versions = project.dependencies;
// Remove the packages from the project! There is really no way for this to
// fail, unless something has gone horribly wrong, so we don't need to check