fix: easy --version and proxy help work without runtime env vars#19
Merged
Conversation
`easy` validated EASY_LETSENCRYPT_DIR and EASY_DOMAINS_DIR at top level, unconditionally — so even `easy --version` and `easy proxy help` failed with `... is not set!` until those env vars were exported. The first command anyone runs after `npm install -g` is `easy --version`, so this was a poor first impression. Found by the pre-publish clean-room test. Skip the dir validation for the two informational invocations (`--version`, `proxy help`); every operational command still validates. - easy: guard the easy_verify_dir calls with a case on "$1:$2" - test/dispatcher.bats: `easy --version` works with the env vars unset - test/proxy.bats: `easy proxy help` works with the env vars unset - CHANGELOG.md: note the fix `npm run lint` exits 0; the bats suite passes 22/22. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Problem
easyvalidatedEASY_LETSENCRYPT_DIRandEASY_DOMAINS_DIRat the top of the script, unconditionally — before any command runs. So even informational commands failed until those env vars were exported:easy --versionis the first thing anyone runs afternpm install -gto confirm the install — a poor first impression.easy proxy helphad the same issue.Found by the pre-publish clean-room test (clean install of the
npm packtarball in adocker:dindcontainer).Fix
Skip the directory validation for the two informational invocations —
easy --versionandeasy proxy help— via acaseon"$1:$2". Every operational command (create,new,certbot-ionos, …) still validates as before.easy— guard theeasy_verify_dircalls.test/dispatcher.bats—easy --versionworks with the env vars unset.test/proxy.bats—easy proxy helpworks with the env vars unset.CHANGELOG.md— note the fix under[2.0.0] Fixed.Test plan
TDD — the two tests were written first, watched fail against the old unconditional validation, then made green.
🤖 Generated with Claude Code