cargo-binstall/e2e-tests/specific-binaries.sh
Jiahao XU 4750f54e6b
fix specific-binaries.sh: relax no-compile
Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com>
2025-06-10 21:11:07 +10:00

33 lines
815 B
Bash
Executable file

#!/bin/bash
set -euxo pipefail
unset CARGO_INSTALL_ROOT
CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')
export CARGO_HOME
export PATH="$CARGO_HOME/bin:$PATH"
# Install a specific binary, ensuring we don't fallback to source.
"./$1" binstall --no-confirm taplo-cli --bin taplo
# Verify that the binary was installed and is executable
if ! command -v taplo >/dev/null 2>&1; then
echo "taplo was not installed"
exit 1
fi
# Run the binary to check it works
taplo --version
# Install a specific binary, but always compile from source.
"./$1" binstall --no-confirm ripgrep --bin rg --strategies compile
# Verify that the binary was installed and is executable
if ! command -v rg >/dev/null 2>&1; then
echo "rg was not installed"
exit 1
fi
# Run the binary to check it works
rg --version