mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00

* feat: Impl new option `--continue-on-failure` Resolve #1548 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Add new e2e-tests continue-on-failure Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Rm dup line ion `e2e-tests/live.sh` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix shellcheck Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Fix `BinstallError::crate_errors` if `errors.len()` is 1 In that case, it should return `Some(Self::CrateContext(_))` instead of `Some(Self::Errors(_))` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Add more tests to `e2e-tests/continue-on-failure.sh` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Propagate crate errors on `confirm()` err Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> * Test having two errors in `e2e-tests/continue-on-failure.sh` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> --------- Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
56 lines
1.5 KiB
Bash
Executable file
56 lines
1.5 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
unset CARGO_INSTALL_ROOT
|
|
|
|
# - `b3sum@<=1.3.3` would test `fetch_crate_cratesio_version_matched` ability
|
|
# to find versions matching <= 1.3.3
|
|
# - `cargo-quickinstall` would test `fetch_crate_cratesio_version_matched` ability
|
|
# to find latest stable version.
|
|
crates="b3sum@<=1.3.3 cargo-release@0.24.9 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3 cargo-quickinstall"
|
|
|
|
CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')
|
|
export CARGO_HOME
|
|
othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test')
|
|
export PATH="$CARGO_HOME/bin:$othertmpdir/bin:$PATH"
|
|
|
|
mkdir -p "$othertmpdir/bin"
|
|
# Copy it to bin to test use of env var `CARGO`
|
|
cp "./$1" "$othertmpdir/bin/"
|
|
|
|
# Install binaries using cargo-binstall
|
|
# shellcheck disable=SC2086
|
|
cargo binstall --no-confirm $crates
|
|
|
|
rm -r "$othertmpdir"
|
|
|
|
# Test that the installed binaries can be run
|
|
b3sum_version="$(b3sum --version)"
|
|
echo "$b3sum_version"
|
|
|
|
[ "$b3sum_version" = "b3sum 1.3.3" ]
|
|
|
|
cargo_release_version="$(cargo-release release --version)"
|
|
echo "$cargo_release_version"
|
|
|
|
[ "$cargo_release_version" = "cargo-release 0.24.9" ]
|
|
|
|
cargo binstall --help >/dev/null
|
|
|
|
cargo_binstall_version="$(cargo-binstall -V)"
|
|
echo "cargo-binstall version $cargo_binstall_version"
|
|
|
|
[ "$cargo_binstall_version" = "0.20.1" ]
|
|
|
|
cargo_watch_version="$(cargo watch -V)"
|
|
echo "$cargo_watch_version"
|
|
|
|
[ "$cargo_watch_version" = "cargo-watch 8.4.0" ]
|
|
|
|
miniserve_version="$(miniserve -V)"
|
|
echo "$miniserve_version"
|
|
|
|
[ "$miniserve_version" = "miniserve 0.23.0" ]
|
|
|
|
cargo-quickinstall -V
|