Commit Graph

9 Commits

Author SHA1 Message Date
Laszlo Nagy 5badd0912b fix install script for distro packaging (fixes #685)
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>
2026-04-05 05:10:07 +00:00
Alexey Sokolov 10781d50e9 Install binaries to /usr/libexec instead of /usr/share
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.
2026-04-04 22:13:00 +11:00
Laszlo Nagy 4914e0be17 feat: add DESTDIR support to install.sh for packaging
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>
2026-03-30 09:47:44 +00:00
Laszlo Nagy 297d89fbf7 add shell completion generation for bash, zsh, fish, and elvish
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>
2026-03-21 05:42:19 +00:00
Laszlo Nagy 040c2e786f rename DESTDIR to PREFIX in install script, tests, and docs
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>
2026-03-21 04:53:07 +00:00
Laszlo Nagy 8a573f8113 hardening scripts/install.sh script 2026-03-18 05:43:20 +00:00
Laszlo Nagy 7cd665d4d7 validate INTERCEPT_LIBDIR at build and install time
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>
2026-03-18 03:03:40 +00:00
Laszlo Nagy 51c8c13bf1 integration tests: use install.sh instead of hand-rolled setup
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>
2026-03-14 12:15:46 +00:00
Laszlo Nagy 8a728c6f4f add install.sh script and rewrite INSTALL.md
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>
2026-03-14 11:50:23 +00:00