diff --git a/packages/playwright/src/runner/tasks.ts b/packages/playwright/src/runner/tasks.ts index 08f030dc0c..1bf4acfc37 100644 --- a/packages/playwright/src/runner/tasks.ts +++ b/packages/playwright/src/runner/tasks.ts @@ -84,12 +84,12 @@ export function createTaskRunnerForWatch(config: FullConfigInternal, reporter: R } function addGlobalSetupTasks(taskRunner: TaskRunner, config: FullConfigInternal) { + if (!config.configCLIOverrides.preserveOutputDir && !process.env.PW_TEST_NO_REMOVE_OUTPUT_DIRS) + taskRunner.addTask('clear output', createRemoveOutputDirsTask()); for (const plugin of config.plugins) taskRunner.addTask('plugin setup', createPluginSetupTask(plugin)); if (config.config.globalSetup || config.config.globalTeardown) taskRunner.addTask('global setup', createGlobalSetupTask()); - if (!config.configCLIOverrides.preserveOutputDir && !process.env.PW_TEST_NO_REMOVE_OUTPUT_DIRS) - taskRunner.addTask('clear output', createRemoveOutputDirsTask()); } function addRunTasks(taskRunner: TaskRunner, config: FullConfigInternal) { diff --git a/utils/pack_package.js b/utils/pack_package.js index 5989b49867..8ef6f4cee7 100644 --- a/utils/pack_package.js +++ b/utils/pack_package.js @@ -19,6 +19,7 @@ const os = require('os'); const path = require('path'); const { spawnSync } = require('child_process'); +const SCRIPT_NAME = path.basename(__filename); // 1. Parse CLI arguments const args = process.argv.slice(2); if (args.some(arg => arg === '--help')) {