Skip to content

Commit

Permalink
Fix test-packages after an initial build failure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
glasser committed Apr 18, 2015
1 parent d310c3e commit 131a8cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 131a8cc

Please sign in to comment.