Skip to content

Commit

Permalink
add comments to explain the rationale behind the stdio option when …
Browse files Browse the repository at this point in the history
…running the docker helper script
  • Loading branch information
m5r committed Jul 10, 2024
1 parent 25155e7 commit b0d8f46
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/e2e/cht-docker-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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
Expand Down

0 comments on commit b0d8f46

Please sign in to comment.