hex/scripts/install-linux.sh
Dax a55e968f4a
Report a dev-local version for builds outside the Release workflow (#309)
* Report 0.0.0-dev-local-<commit> for builds outside the Release workflow

* Keep update-channel tests and goldens independent of the build's version
2026-10-28 15:56:15 -04:00

22 lines
627 B
Shell
Executable file

#!/bin/sh
set -eu
root=$(CDPATH='' cd -- "$(dirname -- "$0")/.." && pwd)
installer="$root/scripts/install-linux-release.sh"
if [ "${1:-install}" = uninstall ]; then
exec "$installer" uninstall
fi
if [ "${1:-install}" != install ]; then
echo "Usage: $0 [install|uninstall]" >&2
exit 1
fi
target_dir=${CARGO_TARGET_DIR:-"$root/target"}
cargo build --locked --release --manifest-path "$root/Cargo.toml"
version=$("$target_dir/release/hex" --version | awk 'NF { value=$NF } END { print value }')
HEX_INSTALL_SOURCE=1 \
HEX_INSTALL_ARTIFACT="$target_dir/release/hex" \
HEX_INSTALL_VERSION="$version" \
exec "$installer"