Skip to content

fix(cli): reject empty-name target in wheels packages install#2290

Merged
bpamiri merged 1 commit intodevelopfrom
claude/zealous-chebyshev-34fe29
Apr 24, 2026
Merged

fix(cli): reject empty-name target in wheels packages install#2290
bpamiri merged 1 commit intodevelopfrom
claude/zealous-chebyshev-34fe29

Conversation

@bpamiri
Copy link
Copy Markdown
Collaborator

@bpamiri bpamiri commented Apr 24, 2026

Summary

  • PackagesMainCli.\$parseTarget crashed on Lucee 7 (and produced a cryptic empty-name install on other engines) when invoked with a target that starts with @, e.g., wheels packages install @1.0.0.
  • Root cause: Left(target, Find(\"@\", target) - 1) evaluates to Left(str, 0), which is explicitly called out as a Lucee 7 hazard in CLAUDE.md.
  • Fix: throw Wheels.Packages.BadInput with a clear syntax hint when the name segment is empty.

Spotted while closing out wheels-dev/wheels#2270; the scope of that issue ships via #2276 + #2287 and this is a small defensive follow-up, not a new feature.

Test plan

  • bash tools/test-cli-local.sh — 437 pass, 0 fail, 0 error (includes new regression spec install throws BadInput when target starts with '@' (empty name)).
  • CI compat matrix green across Lucee 5/6/7 + Adobe 2018/2021/2023/2025 + BoxLang.

`$parseTarget` called `Left(target, Find("@", target) - 1)` without
guarding against targets starting with `@` (e.g., `wheels packages
install @1.0.0`). That evaluates to `Left(str, 0)`, which crashes on
Lucee 7 per the documented gotcha in CLAUDE.md and produces a cryptic
empty-name install attempt on other engines.

Throw `Wheels.Packages.BadInput` explicitly when the name segment is
empty, with a message that points at the correct syntax. Preserves the
existing valid-input paths (no `@`, or `name@version`).

Adds a regression spec in PackagesMainCliSpec.
@bpamiri bpamiri merged commit e5e3e9e into develop Apr 24, 2026
3 checks passed
@bpamiri bpamiri deleted the claude/zealous-chebyshev-34fe29 branch April 24, 2026 18:23
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