Skip to content

fix(cli): hard-fail invalid WHEELS_FRAMEWORK_PATH instead of silent fallback (#2215)#2222

Merged
bpamiri merged 1 commit into
developfrom
claude/blissful-elion-ebeb75
Apr 22, 2026
Merged

fix(cli): hard-fail invalid WHEELS_FRAMEWORK_PATH instead of silent fallback (#2215)#2222
bpamiri merged 1 commit into
developfrom
claude/blissful-elion-ebeb75

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 22, 2026

Fixes #2215.

Summary

  • resolveFrameworkSource() used to append an invalid WHEELS_FRAMEWORK_PATH to the search list and silently fall through to tier 2/3 auto-discovery — the user's explicit override was ignored, and a typo'd or stale path could resolve to a surprising framework version.
  • Now throws Wheels.FrameworkPathInvalid when the env var is set but directoryExists() is false. Picocli maps this to exit code 1 (same mechanism as fix(cli): wheels new exits non-zero on framework-not-found (#2211) #2216).
  • Error message echoes the bad path and suggests both remedies (unset to use auto-discovery, or point at a valid vendor/wheels/).

Structural note

Moved override out of the try block so the new throw isn't swallowed by the catch-all that guards getenv() availability. The catch still only suppresses Java/env-access errors (override stays empty → tier 1 skipped → fallbacks engage normally).

Acceptance criteria (from #2215)

  • WHEELS_FRAMEWORK_PATH=/does/not/exist wheels new foo exits non-zero with a clear message
  • Unsetting the variable restores the auto-discovery fallback behavior (tier 2/3 unchanged)
  • WHEELS_FRAMEWORK_PATH=/valid/path wheels new foo still works

Test plan

Related

…allback (#2215)

When WHEELS_FRAMEWORK_PATH was set but pointed at a non-existent
directory, resolveFrameworkSource() appended the path to the search
list and fell through to tier 2/3 auto-discovery. The user's explicit
override was silently ignored — a typo or stale path could resolve to
a surprising framework version instead of failing loudly.

Throw Wheels.FrameworkPathInvalid when the override is set but
directoryExists() is false. Picocli maps this to exit code 1 (same
mechanism as #2216). Error message echoes the bad path and suggests
both remedies (unset or point at a valid source).

Moved the `override` var out of the try so the throw isn't swallowed
by the catch-all that guards getenv() availability.

Extended test-new-exit-codes.sh with a GH #2215 section: invalid path
must exit non-zero, error must echo the bad path, no partial scaffold.
Verified RED pre-fix (exit 0, silent fallback) and GREEN post-fix.
@bpamiri bpamiri force-pushed the claude/blissful-elion-ebeb75 branch from 7e318cf to 9699f6f Compare April 22, 2026 19:13
@bpamiri bpamiri merged commit 4e8b1bb into develop Apr 22, 2026
4 checks passed
@bpamiri bpamiri deleted the claude/blissful-elion-ebeb75 branch April 22, 2026 19:18
bpamiri added a commit that referenced this pull request Apr 22, 2026
…rce checkout (#2223) (#2225)

When invoked as `wheels`, LuCLI loads modules from ~/.wheels/modules/wheels/.
If that path is a real directory holding a pre-install copy of Module.cfc,
edits a contributor makes under cli/lucli/ in a source checkout silently do
not take effect — surfaced during #2222, where the merged #2216 fix kept
exit-0'ing locally because the installed module was a pre-fix copy.

`wheels doctor` now detects this when run from a wheels source checkout
(projectRoot contains cli/lucli/Module.cfc + vendor/wheels/). The installed
Module.cfc is inspected three ways:

- symlink to the checkout → pass
- real file, bytes match → pass (stale but harmless this moment)
- real file, bytes diverge → warn, with a `rm -rf && ln -s` remediation
  command in the recommendations section

The check is a no-op outside source checkouts and when the installed path
is the checkout's own cli/lucli/ (dev-symlinked install). Symlink detection
and byte comparison go through java.nio.file.Files for cross-engine parity.

Closes #2223.
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.

wheels new: explicit WHEELS_FRAMEWORK_PATH should hard-fail when it doesn't exist

1 participant