mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Handle more errors in ensureDevBundleLink.
If a developer tried to `meteor update` a project whose `.meteor/release` file corresponded to a version of `meteor-tool` that no longer exists in `~/.meteor/packages/meteor-tool`, this code would throw an ENOENT error. This could be fixed by running `meteor update --release <old release>` first, but that kind of workaround shouldn't be necessary when updating Meteor to the latest version.
This commit is contained in:
@@ -1399,7 +1399,12 @@ _.extend(exports.ReleaseFile.prototype, {
|
||||
}
|
||||
}
|
||||
|
||||
return files.realpath(devBundle);
|
||||
try {
|
||||
return files.realpath(devBundle);
|
||||
} catch (e) {
|
||||
if (e.code !== "ENOENT") throw e;
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
// Make a symlink from .meteor/local/dev_bundle to the actual dev_bundle.
|
||||
@@ -1422,9 +1427,10 @@ _.extend(exports.ReleaseFile.prototype, {
|
||||
return;
|
||||
}
|
||||
|
||||
files.mkdir_p(localDir);
|
||||
|
||||
const newTarget = this.getDevBundle();
|
||||
if (! newTarget) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const oldOSPath = readLink(devBundleLink);
|
||||
@@ -1435,15 +1441,16 @@ _.extend(exports.ReleaseFile.prototype, {
|
||||
return;
|
||||
}
|
||||
|
||||
files.mkdir_p(localDir);
|
||||
makeLink(newTarget, devBundleLink);
|
||||
|
||||
} catch (e) {
|
||||
if (e.code !== "ENOENT") {
|
||||
// It's ok if files.realpath(devBundleLink) failed because the
|
||||
// devBundleLink file does not exist.
|
||||
// It's ok if the above commands failed because the target path
|
||||
// did not exist, but other errors should not be silenced.
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
makeLink(newTarget, devBundleLink);
|
||||
},
|
||||
|
||||
write: function (releaseName) {
|
||||
|
||||
Reference in New Issue
Block a user