Skip to content

fix: easy --version and proxy help work without runtime env vars#19

Merged
montoyaedu merged 1 commit into
masterfrom
fix/version-help-no-env
May 18, 2026
Merged

fix: easy --version and proxy help work without runtime env vars#19
montoyaedu merged 1 commit into
masterfrom
fix/version-help-no-env

Conversation

@montoyaedu
Copy link
Copy Markdown
Member

Problem

easy validated EASY_LETSENCRYPT_DIR and EASY_DOMAINS_DIR at the top of the script, unconditionally — before any command runs. So even informational commands failed until those env vars were exported:

$ easy --version
... - [INFO ] - EASY_LETSENCRYPT_DIR is not set!     # expected: 2.0.0

easy --version is the first thing anyone runs after npm install -g to confirm the install — a poor first impression. easy proxy help had the same issue.

Found by the pre-publish clean-room test (clean install of the npm pack tarball in a docker:dind container).

Fix

Skip the directory validation for the two informational invocations — easy --version and easy proxy help — via a case on "$1:$2". Every operational command (create, new, certbot-ionos, …) still validates as before.

  • easy — guard the easy_verify_dir calls.
  • test/dispatcher.batseasy --version works with the env vars unset.
  • test/proxy.batseasy proxy help works 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.

npm run lint   # exits 0
bats test/     # 22/22 (was 20 + 2 new)

🤖 Generated with Claude Code

`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>
@montoyaedu montoyaedu merged commit 3fcdccd into master May 18, 2026
2 checks passed
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