fix: delete management/ncp.ps1 - it shadowed the ncp.cmd PATH shim
PowerShell resolves ExternalScript (.ps1) ahead of Application (.cmd), and both lived in the directory the installer puts on PATH -- so in PowerShell `ncp` ran the .ps1 and was execution-policy-bound again, the exact thing the .cmd exists to avoid. Its other justification (giving ncp to pwsh on Linux) stopped being true once /usr/local/bin/ncp existed: pwsh runs a PATH symlink to a shell script as an Application. A test now prevents the file coming back. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+13
-1
@@ -96,6 +96,18 @@ def test_ncp_is_registered_on_path_not_in_a_shell_profile():
|
||||
"model pull must come after the desktop shortcut"
|
||||
|
||||
|
||||
def test_no_ps1_shadows_the_ncp_path_shim():
|
||||
"""PowerShell resolves ExternalScript (.ps1) ahead of Application (.cmd), so
|
||||
an ncp.ps1 sitting next to ncp.cmd wins in PowerShell and drags the execution
|
||||
policy back in - the exact thing the .cmd exists to avoid. Observed on the
|
||||
Windows VM: `Get-Command ncp -All` listed ncp.ps1 first, from the same
|
||||
directory the installer had just put on PATH."""
|
||||
shim = REPO_ROOT / "management" / "ncp.cmd"
|
||||
assert shim.exists(), "the Windows PATH shim is missing"
|
||||
twin = shim.with_suffix(".ps1")
|
||||
assert not twin.exists(), f"{twin.name} shadows {shim.name} in PowerShell"
|
||||
|
||||
|
||||
|
||||
def test_first_playbook_is_the_system_prompt(tmp_path, monkeypatch):
|
||||
store = PlaybookFileStore(tmp_path)
|
||||
@@ -268,7 +280,7 @@ def test_desktop_stage_is_the_only_one_touching_home():
|
||||
# and in the PowerShell profile is how you launch NexusOS at all, and each is
|
||||
# a grep-guarded no-op on re-run. Desktop config (xfconf, plank, themes,
|
||||
# os-release) must stay in the desktop stage so --no-desktop really is safe.
|
||||
shell_wiring = (".bashrc", "powershell/profile.ps1")
|
||||
shell_wiring = (".bashrc",)
|
||||
home_writes = [ln for ln in runtime.splitlines()
|
||||
if "$HOME" in ln and not any(w in ln for w in shell_wiring)]
|
||||
assert not home_writes, f"runtime stage writes to $HOME: {home_writes}"
|
||||
|
||||
Reference in New Issue
Block a user