Repository navigation
fix(pgpm): cascade --no-tty through init template scaffolding - #1477
Merged
Merged
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pgpm init workspace --no-tty ...crashed withError [ERR_USE_AFTER_CLOSE]: readline was closedwhenever any boilerplate question (fullName/email/repoName/username/license) was left to be prompted, because--no-ttynever reached the prompter that asks the template questions:CLIbuilds the shared prompter withnoTty: options.noTty(defaultfalse) and never reads--no-ttyfrom argv.initcomputed its ownnoTtyflag and passed it toscaffoldTemplate, but also passed the shared prompter — and genomic'spromptUserdoesexistingPrompter ?? new Inquirerer({ noTty }), so the flag was ignored and template questions went down the interactive TTY path (crashing on non-TTY/EOF stdin).Fixes:
pgpm/cli/src/index.ts:new CLI(commands, { ...options, noTty: detectNoTtyFromProcess() })—--no-tty/CI=truenow makes the CLI's own prompter non-interactive.@pgpmjs/corescaffoldTemplate:prompter: noTty ? undefined : prompter— in noTty mode the templatizer builds its own noTty prompter, guaranteeing the flag cascades to genomic/inquirerer.isNoTtyRequested(argv)/detectNoTtyFromProcess()helpers inpgpm/cli/src/utils/tty.tsreplace the three duplicated inline checks in init.starter-kits.mdnow documents the non-interactive workspace flags and their resolver defaults (git config,npm whoami, workspace dirname).Behavior after fix (verified locally against built dist):
--fullName/--email/--repoNameomitted with git identity present → resolved from defaultsFollow-ups deferred (per discussion): enumerating the missing flags in the error message lives in inquirerer/genomic.
Link to Devin session: https://app.devin.ai/sessions/d0cd8a9a2bed466d9e89f582346cb826
Requested by: @pyramation