mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
Use CARGO
env variable if present (#453)
* Run `$CARGO -vV` in `detect-targets` if env `CARGO` present * Improve crate doc for `detect-targets` * Use env var `CARGO` in `install_from_source` if present * Test use of `CARGO` env in `tests.sh` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
448542f0c8
commit
ec2bdb551e
5 changed files with 48 additions and 18 deletions
30
.github/scripts/tests.sh
vendored
30
.github/scripts/tests.sh
vendored
|
@ -3,17 +3,25 @@
|
|||
set -euxo pipefail
|
||||
|
||||
unset CARGO_INSTALL_ROOT
|
||||
unset CARGO_HOME
|
||||
|
||||
# Install binaries using cargo-binstall
|
||||
# shellcheck disable=SC2086
|
||||
"./$1" binstall --log-level debug --no-confirm \
|
||||
b3sum \
|
||||
cargo-release \
|
||||
cargo-binstall \
|
||||
cargo-watch \
|
||||
miniserve \
|
||||
sccache
|
||||
crates="b3sum cargo-release cargo-binstall cargo-watch miniserve sccache"
|
||||
|
||||
if [ "$2" = "Windows" ]; then
|
||||
# Install binaries using cargo-binstall
|
||||
# shellcheck disable=SC2086
|
||||
"./$1" --log-level debug --no-confirm $crates
|
||||
else
|
||||
export CARGO_HOME=/tmp/cargo-home-for-test
|
||||
export PATH="$CARGO_HOME/bin:$PATH"
|
||||
|
||||
mkdir -p "$CARGO_HOME/bin"
|
||||
# Copy it to bin to test use of env var `CARGO`
|
||||
cp "./$1" "$CARGO_HOME/bin/cargo-binstall"
|
||||
|
||||
# Install binaries using cargo-binstall
|
||||
# shellcheck disable=SC2086
|
||||
cargo binstall --log-level debug --no-confirm $crates
|
||||
fi
|
||||
|
||||
# Test that the installed binaries can be run
|
||||
b3sum --version
|
||||
|
@ -69,7 +77,7 @@ cargo binstall --help >/dev/null
|
|||
|
||||
# to force failure if falling back to source
|
||||
# FIXME: remove/replace once #136 lands
|
||||
PATH="$test_resources/fake-cargo:$PATH"
|
||||
export PATH="$test_resources/fake-cargo:$PATH"
|
||||
|
||||
# Test default GitLab pkg-url templates
|
||||
"./$1" binstall \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue