Skip to content

Commit

Permalink
stdin resume instead of exit at end
Browse files Browse the repository at this point in the history
  • Loading branch information
jbolda committed Jul 2, 2024
1 parent 85e07df commit bdd95b5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/covector/src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ export const init = function* init({
const answers: Awaited<typeof questions> = yield questions;
outro("Generating files...");

// https://github.com/bombshell-dev/clack/issues/134
// stdin seems to get "stuck", this shakes it up and allows the process to complete
// this is currently only noted to occur in tests
process.stdin.resume();

try {
const testOpen: Dir = yield fs.opendir(path.posix.join(cwd, changeFolder));
logger.info(`The ${changeFolder} folder exists, skipping creation.`);
Expand Down Expand Up @@ -280,8 +285,6 @@ export const init = function* init({
}
}

// tests struggle to close `stdin` and we don't use the return value anyways
process.exit();
return "complete";
};

Expand Down

0 comments on commit bdd95b5

Please sign in to comment.