From ea236fc9da99a1679b6205dce3a7008617e660e5 Mon Sep 17 00:00:00 2001 From: Ben Newman Date: Tue, 12 Jul 2016 11:40:42 -0400 Subject: [PATCH] Try harder to create .meteor/dev_bundle symlink. May help with #7391. --- tools/cli/dev-bundle-links.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/cli/dev-bundle-links.js b/tools/cli/dev-bundle-links.js index d6d4af9349..bb157dce56 100644 --- a/tools/cli/dev-bundle-links.js +++ b/tools/cli/dev-bundle-links.js @@ -13,7 +13,13 @@ exports.makeLink = function (target, linkPath) { fs.writeFileSync(tempPath, target, "utf8"); } - fs.renameSync(tempPath, linkPath); + try { + fs.renameSync(tempPath, linkPath); + } catch (e) { + // If renaming fails, try unlinking first. + fs.unlinkSync(linkPath); + fs.renameSync(tempPath, linkPath); + } }; exports.readLink = function (linkPath) {