The installer hardcoded target/ as the build output directory, but
CARGO_TARGET_DIR (or [build] target-dir in cargo config) can redirect
output anywhere (e.g., /tmp/cargo-target). Now uses cargo metadata
--format-version 1 to get the actual target_directory, falling back
to $SCRIPT_DIR/target if metadata fails.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The script now: runs the binary with --test after install to verify it
actually works, prints the statusLine JSON that was written to settings,
handles corrupt/invalid settings.json by backing up and writing fresh,
and emphasizes that Claude Code must be restarted to pick up the change.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Nightly toolchains with CARGO_BUILD_TARGET set (or .cargo/config.toml
[build] target) put the binary in target/<triple>/release/ instead of
target/release/. The installer now falls back to a find search across
all target subdirectories when the standard path doesn't exist.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cargo build --quiet swallowed compiler errors, and the subshell (...)
didn't reliably propagate exit codes across bash versions. The script
continued past a failed build, then ls/cp failed on the missing binary.
Now: removed --quiet so errors are visible, explicit exit-code check
with common-cause hints (build-essential, libc6-dev), and a secondary
check that the binary actually exists before attempting to install it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>