From 48ea3c8c7fa7c4175004d14ce0b477a6875c00c7 Mon Sep 17 00:00:00 2001 From: Robert Jackson Date: Mon, 2 Nov 2020 10:27:19 -0500 Subject: [PATCH] Restore dependencies after running scenarios IFF there are multiple scenarios. 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. --- lib/tasks/try-each.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/tasks/try-each.js b/lib/tasks/try-each.js index fe643d7e..234fc65f 100644 --- a/lib/tasks/try-each.js +++ b/lib/tasks/try-each.js @@ -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); @@ -97,8 +101,6 @@ module.exports = CoreObject.extend({ runResults.result = result; this._writeFooter(`Result: ${result}`); - await this.ScenarioManager.restoreOriginalDependencies(); - return runResults; },