Files
coucou/scripts/test-nvm-brain.sh
T
Nicolas De LetterandClaude Opus 5.5 08ee780000 Find brain when nvm's default alias is partial (#1254)
Coucou looked for brain at ~/.nvm/versions/node/<default alias>/bin, but
nvm's default alias is usually partial (`22`, `lts/*`, `node`) while Node
lives in versions/node/v22.23.4. The login-shell fallback can't help
either: nvm sets itself up in ~/.zshrc, which `zsh -l -c` never loads,
so the Mochis and Memory pages said they couldn't reach brain.

NvmBinaryLocator follows nvm's alias files to the newest matching
installed version, then falls back to the newest Node that has brain.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 21:22:59 +00:00

10 lines
363 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
TEST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/coucou-nvm-brain.XXXXXX")"
trap 'rm -rf "$TEST_DIR"' EXIT
swiftc -swift-version 6 -strict-concurrency=complete \
NotchBuddy/Sources/App/NvmBinaryLocator.swift \
tests/NvmBinaryLocatorTests.swift -o "$TEST_DIR/nvm-brain-tests"
"$TEST_DIR/nvm-brain-tests"