Skip to content

Repair the tools\np path literal the PATH registration is built from - #223

Merged
Sev7eNup merged 1 commit into
mainfrom
fix/tools-path-literal
Aug 16, 2026
Merged

Repair the tools\np path literal the PATH registration is built from#223
Sev7eNup merged 1 commit into
mainfrom
fix/tools-path-literal

Conversation

@Sev7eNup

Copy link
Copy Markdown
Owner

Problem

An editing slip in #219 split 'tools\np' across two lines — the string ended up containing a literal newline:

$toolsPath = Join-Path $InstallPath 'tools
p'

Join-Path then produced a path Test-Path rejects with "Illegal characters in path", the surrounding catch downgraded it to a warning, and the install/update finished green with np never reaching the machine PATH.

Present in all three scripts (Install-, Update-, Uninstall-NodePilot.ps1), therefore in both 1.2.8 and 1.2.9. Observed while updating the lab installation to 1.2.9:

[update] Installation marker updated to version 1.2.9.
[update] Could not update the machine PATH: Illegal characters in path.
[update] Update complete.

The clients themselves were never affected — they are part of the signed artifact and land under tools\ regardless. Only the convenience of typing np instead of the full path was missing.

Why the guard did not catch it

Test-DeploymentTemplates.ps1 asserted that each script calls Add-NodePilotPathEntry / Remove-NodePilotPathEntry and dot-sources MachinePath.ps1. A mangled argument satisfies all of that.

It now pins the directory literal on one line too, for all three scripts. Verified both ways: re-introducing the newline fails the check (exit 1, naming the script), repairing it passes (exit 0).

Follow-up

The published 1.2.8 and 1.2.9 installers carry the broken script. Anyone who has already installed can add <install>\tools\np to the machine PATH by hand, or re-run the corrected updater.

An editing slip in the change that shipped the operator clients split
'tools\np' across two lines: the string ended up containing a literal newline, so
Join-Path produced a path Test-Path rejects with "Illegal characters in path".
The surrounding catch downgraded that to a warning, the install and the update
succeeded either way, and `np` silently never reached the machine PATH. Present
in all three scripts, therefore in both 1.2.8 and 1.2.9. Observed on the lab
install: updating to 1.2.9 wrote "[update] Could not update the machine PATH:
Illegal characters in path" and finished green.

The clients themselves were never affected -- they are part of the signed
artifact and land under tools\ regardless.

The contract test asserted only that each script calls the shared helper, which a
mangled argument satisfies perfectly. It now pins the directory literal on one
line as well, in all three scripts. Verified by re-introducing the newline: the
check fails, and passes again once repaired.
@Sev7eNup
Sev7eNup merged commit 17e0f5c into main Aug 16, 2026
9 checks passed
@Sev7eNup
Sev7eNup deleted the fix/tools-path-literal branch August 16, 2026 18:31
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