fix(packages): join else with } on service_complete Phase 1 chains #148

Merged
mahmoud merged 1 commit from fix/service-complete-else-147 into development 2026-04-28 06:10:57 +00:00
Owner

Fixes #147.

Summary

  • Collapse Phase 1 if $core { ... } else { ... } inner chains in service_complete onto single lines so Nushell's parser accepts them.
  • The previous form put } and else on separate lines, which the parser rejects with Command \else` not found, blocking the entire service_complete` function from loading.

Why this is the right fix

Nushell requires else / else if to share a line with the preceding block's closing }. The rest of packages.nu already follows this convention — service_install_all (lines 62-68), Phase 2 of service_complete (lines 196-219), and the WASM phase (lines 254-260) — so this PR brings Phase 1 in line with the rest of the file rather than introducing a new style.

Verification

On kristof6 (Nushell session that originally hit the error):

$ nu -c 'use tools/modules/services/packages.nu *; help service_complete | head -5'
Install AND start (register with hero_proc) all Hero services in
dependency order.
...

The function now parses cleanly. Functional behavior is unchanged — the if/else semantics across the four branches ($core × $reset/$update/neither) are identical.

Test plan

  • service_complete parses (loads via use)
  • No-flag invocation reaches Phase 1 (was failing at parse time before)
  • End-to-end service_complete --update --reset --wasm on a clean kristof6 (deferred — separate from this parser fix)
Fixes #147. ## Summary - Collapse Phase 1 `if $core { ... } else { ... }` inner chains in `service_complete` onto single lines so Nushell's parser accepts them. - The previous form put `}` and `else` on separate lines, which the parser rejects with `Command \`else\` not found`, blocking the entire `service_complete` function from loading. ## Why this is the right fix Nushell requires `else` / `else if` to share a line with the preceding block's closing `}`. The rest of `packages.nu` already follows this convention — `service_install_all` (lines 62-68), Phase 2 of `service_complete` (lines 196-219), and the WASM phase (lines 254-260) — so this PR brings Phase 1 in line with the rest of the file rather than introducing a new style. ## Verification On `kristof6` (Nushell session that originally hit the error): ``` $ nu -c 'use tools/modules/services/packages.nu *; help service_complete | head -5' Install AND start (register with hero_proc) all Hero services in dependency order. ... ``` The function now parses cleanly. Functional behavior is unchanged — the if/else semantics across the four branches (`$core` × `$reset`/`$update`/neither) are identical. ## Test plan - [x] `service_complete` parses (loads via `use`) - [x] No-flag invocation reaches Phase 1 (was failing at parse time before) - [ ] End-to-end `service_complete --update --reset --wasm` on a clean kristof6 (deferred — separate from this parser fix)
fix(packages): join else with } on service_complete Phase 1 chains (#147)
All checks were successful
Build and Publish Skills / build-and-publish (pull_request) Successful in 3s
0501b13401
Nushell requires `else` / `else if` to be on the same line as the previous
block's closing `}`. The Phase 1 if/else chain in `service_complete` was
written with `}` and `else` on separate lines, causing the parser to fail
to load the entire function with `Command else not found`.

Collapse each branch onto a single line, matching the style already used
in service_install_all (lines 62-68) and Phase 2 of service_complete
(lines 196-219).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mahmoud merged commit 4ddc9fad71 into development 2026-04-28 06:10:57 +00:00
mahmoud deleted branch fix/service-complete-else-147 2026-04-28 06:11:02 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills!148
No description provided.