mirror of
https://github.com/Louis-CFM/coucou.git
synced 2026-12-06 23:24:20 +09:00
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>
10 lines
363 B
Bash
Executable File
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"
|