From bdd95b56ad815a1e30e44605722ca4d9a3fb325d Mon Sep 17 00:00:00 2001 From: Jacob Bolda Date: Tue, 2 Jul 2024 14:19:58 -0500 Subject: [PATCH] stdin resume instead of exit at end --- packages/covector/src/init.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/covector/src/init.ts b/packages/covector/src/init.ts index 7bde482d..60aee35d 100644 --- a/packages/covector/src/init.ts +++ b/packages/covector/src/init.ts @@ -121,6 +121,11 @@ export const init = function* init({ const answers: Awaited = 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.`); @@ -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"; };