forked from enderofwings/NexusOS
feat: put ncp on PATH on both platforms; rename WSL reqs to Windows
Ports the ncp PATH work from upstream. Registering ncp as a shell-profile function failed three ways on Windows: the default Restricted execution policy blocks the profile itself, profiles don't exist outside PowerShell (cmd, Win+R, Task Scheduler), and the self-elevating installer writes the admin's profile. Windows now ships management/ncp.cmd and the installer appends management\ to the Machine PATH via [Environment]::SetEnvironmentVariable -- never setx, which truncates PATH at 1024 chars. A .cmd is exempt from the execution policy. Linux symlinks /usr/local/bin/ncp -> management/nexus-cli.sh, falling back to the old .bashrc function when sudo is unavailable. Also renames requirements-wsl.txt to requirements-windows.txt and purges stale WSL references, including vite.config.js's dev-server comment and controlpanel.py's "Check WSLg." error string. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+15
-6
@@ -52,11 +52,20 @@ if [ "$stage" = "runtime" ]; then
|
||||
echo "Warning: bin/fetch-ollama.sh not found — skipping Ollama fetch."
|
||||
fi
|
||||
|
||||
# Shell wiring: the `ncp` function and the Promethean venv alias. This is the
|
||||
# only place they get registered now that bin/install.sh is gone. Guarded by a
|
||||
# grep so an in-place restore is a no-op and a scratch clone can't re-point an
|
||||
# already-wired ~/.bashrc at itself.
|
||||
if ! grep -q "management/nexus-cli.sh" "$HOME/.bashrc" 2>/dev/null; then
|
||||
# `ncp` on PATH, not a shell function: /usr/local/bin is visible to sh, cron,
|
||||
# systemd units and .desktop Exec lines, none of which read ~/.bashrc. The
|
||||
# Windows installer does the matching thing with management\ncp.cmd on PATH.
|
||||
# Falls back to the old ~/.bashrc function when there's no sudo (a shell
|
||||
# function shadows the symlink anyway, so having both is harmless).
|
||||
ncp_link="/usr/local/bin/ncp"
|
||||
ncp_target="$NEXUS_ROOT/management/nexus-cli.sh"
|
||||
if [ "$(readlink -f "$ncp_link" 2>/dev/null)" = "$ncp_target" ]; then
|
||||
echo "ncp already on PATH at $ncp_link."
|
||||
elif sudo ln -sfn "$ncp_target" "$ncp_link"; then
|
||||
echo "Registered ncp at $ncp_link."
|
||||
elif ! grep -q "management/nexus-cli.sh" "$HOME/.bashrc" 2>/dev/null; then
|
||||
# Guarded by a grep so an in-place restore is a no-op and a scratch clone
|
||||
# can't re-point an already-wired ~/.bashrc at itself.
|
||||
cat >> "$HOME/.bashrc" <<EOF
|
||||
|
||||
# Nexus
|
||||
@@ -64,7 +73,7 @@ ncp() {
|
||||
$NEXUS_ROOT/management/nexus-cli.sh "\$@"
|
||||
}
|
||||
EOF
|
||||
echo "Registered ncp in ~/.bashrc."
|
||||
echo "No sudo for $ncp_link — registered ncp in ~/.bashrc instead."
|
||||
fi
|
||||
|
||||
if ! grep -qF "alias promethean=" "$HOME/.bashrc" 2>/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user