cargo-binstall/e2e-tests/no-track.sh
Jiahao XU 1432093dcc
feat: Add new cmdline option --no-track (#1111)
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>
2023-06-03 09:15:18 +00:00

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