Skip to content

fix: re-prompt required env variables until non-empty#160

Merged
ben-rogerson merged 3 commits into
mainfrom
fix/required-env-prompt-accepts-empty
May 15, 2026
Merged

fix: re-prompt required env variables until non-empty#160
ben-rogerson merged 3 commits into
mainfrom
fix/required-env-prompt-accepts-empty

Conversation

@ben-rogerson
Copy link
Copy Markdown
Owner

Summary

The promptForEnv function was accepting empty answers for required fields, writing empty strings to .env and causing silent failures. Wrap the prompt in a do-while loop that repeats until the user provides a non-empty value (or signals Ctrl+C).

Test plan

  • pnpm typecheck
  • pnpm lint
  • pnpm test

The promptForEnv function was accepting empty answers for required fields, writing empty strings to .env and causing silent failures. Wrap the prompt in a do-while loop that repeats until the user provides a non-empty value (or signals Ctrl+C).
@ben-rogerson ben-rogerson force-pushed the fix/required-env-prompt-accepts-empty branch from 3b21170 to 0d4daed Compare May 15, 2026 13:33
Add stream-injection params to promptForEnv (defaults to process stdin/stdout)
so the re-prompt loop can be unit-tested without spawning a process.
@ben-rogerson ben-rogerson merged commit aed48b3 into main May 15, 2026
1 check passed
@ben-rogerson ben-rogerson deleted the fix/required-env-prompt-accepts-empty branch May 15, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant