From 131a8cc658e9d9ec6bd0073699551f7714598172 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Fri, 17 Apr 2015 17:47:16 -0700 Subject: [PATCH] Fix test-packages after an initial build failure The comments immediately after this new code claimed that the "changes we made were persisted to disk", but they weren't. So, if you had some sort of build error that occured after the initializeCatalog stage (say, invalid JS in a non-package.js file), when the runner reset the context, it would lose the changes to projectContext.projectConstraintsFile (.meteor/packages), and you'd end up with no packages in the test runner app. --- tools/commands.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/commands.js b/tools/commands.js index 48d1f031d86..60ac0b05e47 100644 --- a/tools/commands.js +++ b/tools/commands.js @@ -1422,6 +1422,10 @@ main.registerCommand({ // .meteor/packages, but that's OK since this isn't a real user project.) projectContext.projectConstraintsFile.removeAllPackages(); projectContext.projectConstraintsFile.addConstraints(constraintsToAdd); + // Write these changes to disk now, so that if the first attempt to prepare + // the project for build hits errors, we don't lose them on + // projectContext.reset. + projectContext.projectConstraintsFile.writeIfModified(); // The rest of the projectContext preparation process will happen inside the // runner, once the proxy is listening. The changes we made were persisted to