Update runtime checks and installer behavior
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -160,6 +160,27 @@ require_command() {
|
||||
fi
|
||||
}
|
||||
|
||||
warn_command_conflict() {
|
||||
expected_path="$INSTALL_BIN_DIR/feynman"
|
||||
resolved_path="$(command -v feynman 2>/dev/null || true)"
|
||||
|
||||
if [ -z "$resolved_path" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [ "$resolved_path" != "$expected_path" ]; then
|
||||
step "Warning: current shell resolves feynman to $resolved_path"
|
||||
step "Run now: export PATH=\"$INSTALL_BIN_DIR:\$PATH\" && hash -r && feynman"
|
||||
step "Or launch directly: $expected_path"
|
||||
|
||||
case "$resolved_path" in
|
||||
*"/node_modules/@companion-ai/feynman/"* | *"/node_modules/.bin/feynman")
|
||||
step "If that path is an old global npm install, remove it with: npm uninstall -g @companion-ai/feynman"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
resolve_release_metadata() {
|
||||
normalized_version="$(normalize_version "$VERSION")"
|
||||
|
||||
@@ -290,20 +311,22 @@ add_to_path
|
||||
case "$path_action" in
|
||||
added)
|
||||
step "PATH updated for future shells in $path_profile"
|
||||
step "Run now: export PATH=\"$INSTALL_BIN_DIR:\$PATH\" && feynman"
|
||||
step "Run now: export PATH=\"$INSTALL_BIN_DIR:\$PATH\" && hash -r && feynman"
|
||||
;;
|
||||
configured)
|
||||
step "PATH is already configured for future shells in $path_profile"
|
||||
step "Run now: export PATH=\"$INSTALL_BIN_DIR:\$PATH\" && feynman"
|
||||
step "Run now: export PATH=\"$INSTALL_BIN_DIR:\$PATH\" && hash -r && feynman"
|
||||
;;
|
||||
skipped)
|
||||
step "PATH update skipped"
|
||||
step "Run now: export PATH=\"$INSTALL_BIN_DIR:\$PATH\" && feynman"
|
||||
step "Run now: export PATH=\"$INSTALL_BIN_DIR:\$PATH\" && hash -r && feynman"
|
||||
;;
|
||||
*)
|
||||
step "$INSTALL_BIN_DIR is already on PATH"
|
||||
step "Run: feynman"
|
||||
step "Run: hash -r && feynman"
|
||||
;;
|
||||
esac
|
||||
|
||||
warn_command_conflict
|
||||
|
||||
printf 'Feynman %s installed successfully.\n' "$resolved_version"
|
||||
|
||||
@@ -146,6 +146,16 @@ Workarounds:
|
||||
Write-Host "$installBinDir is already on PATH."
|
||||
}
|
||||
|
||||
$resolvedCommand = Get-Command feynman -ErrorAction SilentlyContinue
|
||||
if ($resolvedCommand -and $resolvedCommand.Source -ne $shimPath) {
|
||||
Write-Warning "Current shell resolves feynman to $($resolvedCommand.Source)"
|
||||
Write-Host "Run in a new shell, or run: `$env:Path = '$installBinDir;' + `$env:Path"
|
||||
Write-Host "Then run: feynman"
|
||||
if ($resolvedCommand.Source -like "*node_modules*@companion-ai*feynman*") {
|
||||
Write-Host "If that path is an old global npm install, remove it with: npm uninstall -g @companion-ai/feynman"
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Feynman $resolvedVersion installed successfully."
|
||||
} finally {
|
||||
if (Test-Path $tmpDir) {
|
||||
|
||||
@@ -17,6 +17,8 @@ curl -fsSL https://feynman.is/install | bash
|
||||
|
||||
The installer detects your OS and architecture automatically. On macOS it supports both Intel and Apple Silicon. On Linux it supports x64 and arm64. The launcher is installed to `~/.local/bin`, the bundled runtime is unpacked into `~/.local/share/feynman`, and your `PATH` is updated when needed.
|
||||
|
||||
If you previously installed Feynman via `npm`, `pnpm`, or `bun` and still see local Node.js errors after a curl install, your shell is probably still resolving the older global binary first. Run `which -a feynman`, then `hash -r`, or launch the standalone shim directly with `~/.local/bin/feynman`.
|
||||
|
||||
By default, the one-line installer tracks the rolling `edge` channel from `main`.
|
||||
|
||||
On **Windows**, open PowerShell as Administrator and run:
|
||||
@@ -45,7 +47,7 @@ You can also pin an exact version by replacing `stable` with a version such as `
|
||||
|
||||
## pnpm
|
||||
|
||||
If you already have Node.js 20.18.1+ installed, you can install Feynman globally via `pnpm`:
|
||||
If you already have Node.js `20.18.1` or newer installed, you can install Feynman globally via `pnpm`:
|
||||
|
||||
```bash
|
||||
pnpm add -g @companion-ai/feynman
|
||||
@@ -59,6 +61,8 @@ pnpm dlx @companion-ai/feynman
|
||||
|
||||
## bun
|
||||
|
||||
`bun add -g` and `bunx` still use your local Node runtime for Feynman itself, so the same Node.js `20.18.1+` requirement applies.
|
||||
|
||||
```bash
|
||||
bun add -g @companion-ai/feynman
|
||||
```
|
||||
@@ -98,6 +102,7 @@ For contributing or running Feynman from source:
|
||||
```bash
|
||||
git clone https://github.com/getcompanion-ai/feynman.git
|
||||
cd feynman
|
||||
nvm use || nvm install
|
||||
pnpm install
|
||||
pnpm start
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user