From b0d8f463707c658aaf146fe28e8a42c9561ff243 Mon Sep 17 00:00:00 2001 From: m5r Date: Wed, 10 Jul 2024 13:31:54 +0200 Subject: [PATCH] add comments to explain the rationale behind the `stdio` option when running the docker helper script --- test/e2e/cht-docker-utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/e2e/cht-docker-utils.js b/test/e2e/cht-docker-utils.js index 0ed98adb..8286fb7e 100644 --- a/test/e2e/cht-docker-utils.js +++ b/test/e2e/cht-docker-utils.js @@ -89,6 +89,7 @@ const startProject = (projectName) => new Promise((resolve, reject) => { childProcess.on('close', resolve); } else { // initialize a new project, config will be saved to `${projectName}.env` + // stdio: 'pipe' to answer the prompts to initialize a project by writing to stdin const childProcess = spawn(dockerHelperScript, { stdio: 'pipe', cwd: dockerHelperDirectory }); childProcess.on('error', reject); childProcess.on('close', async () => { @@ -103,6 +104,7 @@ const startProject = (projectName) => new Promise((resolve, reject) => { }); const destroyProject = (projectName) => new Promise((resolve, reject) => { + // stdio: 'inherit' to see the script's logs and understand why it requests elevated permissions when cleaning up project files const childProcess = spawn(dockerHelperScript, [`${projectName}.env`, 'destroy'], { stdio: 'inherit', cwd: dockerHelperDirectory