Skip to content

Commit

Permalink
Restore dependencies after running scenarios IFF there are multiple s…
Browse files Browse the repository at this point in the history
…cenarios.

When there is only a single scenario to run (e.g. `ember try:one`) we should not be cleaning up as
part of running the scenario itself because in that case we would immediately cleanup _anyways_. If
we forced cleanup to happen during the scenario run, then it would be impossible to have
`--skip-cleanup` work at all.
  • Loading branch information
rwjblue committed Nov 2, 2020
1 parent 31bfb84 commit 48ea3c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/tasks/try-each.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ module.exports = CoreObject.extend({
let results = [];
for (let scenario of scenarios) {
results.push(await this._runCommandForThisScenario(scenario));

if (scenarios.length > 1) {
await this.ScenarioManager.restoreOriginalDependencies();
}
}

await this._optionallyCleanup(options);
Expand Down Expand Up @@ -97,8 +101,6 @@ module.exports = CoreObject.extend({
runResults.result = result;
this._writeFooter(`Result: ${result}`);

await this.ScenarioManager.restoreOriginalDependencies();

return runResults;
},

Expand Down

0 comments on commit 48ea3c8

Please sign in to comment.