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

Same as `cargo-install`'s `--no-track`. It is also passed to `cargo-install` if it is invoked. Also fixed `fs::atomic_symlink_file` which on Windows could fallback to non-atomic install if symlinking failed. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
28 lines
554 B
Bash
28 lines
554 B
Bash
#!/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"
|
|
|
|
"./$1" binstall -y cargo-binstall@0.20.1
|
|
cargo-binstall --help >/dev/null
|
|
|
|
set +e
|
|
|
|
"./$1" binstall -y --no-track cargo-binstall@0.20.1
|
|
exit_code="$?"
|
|
|
|
set -e
|
|
|
|
if [ "$exit_code" != 74 ]; then
|
|
echo "Expected exit code 74 Io Error, but actual exit code $exit_code"
|
|
exit 1
|
|
fi
|
|
|
|
|
|
"./$1" binstall -y --no-track --force cargo-binstall@0.20.1
|
|
cargo-binstall --help >/dev/null
|