Simplify install.sh: remove uninstall script generation and --uninstall
flag, switch shebang to /bin/sh, drop pipefail. Fix INSTALL.md packaging
instructions to use DESTDIR for staging instead of baking the staging
path into PREFIX.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
According to FHS /usr/share is for arch-independent files.
After #682 the install.sh script became more appropriate for packaging.
And it now installs completions, so replicating its logic by manually
creating the wrapper in /usr/bin is less feasible now.
Allows packagers to stage installations into a separate directory
(e.g., DESTDIR=/tmp/pkg PREFIX=/usr ./scripts/install.sh) without
affecting the runtime paths baked into generated scripts.
Closes#682
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add a `generate-completions` binary that uses clap_complete to produce
shell completion scripts from the existing CLI definition. Completions
are generated for the user-facing `bear` command name.
The install script conditionally installs completions when the generated
files are present under $SRCDIR/completions/.
The binary is bear-driver but users invoke it as bear via a shell
wrapper. Hardcode the name in cli() so --version shows "bear 4.1.0"
instead of "bear-driver".
Add guidance to INSTALL.md for sourcing completions when Bear is
installed to $HOME/.local, since shells only search system prefixes
by default.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
DESTDIR conventionally refers to a staging root for packaging, while
PREFIX is the standard name for an installation prefix. Rename the
variable throughout to follow convention.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reject empty, whitespace-only, and absolute path values in bear/build.rs,
integration-tests/build.rs, and scripts/install.sh. Previously invalid
values would silently produce a broken installation layout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the manual file-copy logic in InstallEnvironment with a call to
scripts/install.sh, so the install script is exercised on every test run.
Add SOURCE_DIR env var to install.sh for pointing at non-release artifact
directories (e.g. target/debug/).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add scripts/install.sh that handles the full installation layout:
binaries, preload library, man page, docs, and a bear entry script.
Accepts DESTDIR and INTERCEPT_LIBDIR as environment variables. Writes
an install manifest so --uninstall can safely remove only installed
files. Refuses DESTDIR=/ as a safety guard.
Rewrite INSTALL.md to reference the script instead of listing manual
commands.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>