cargo-binstall/e2e-tests/uninstall.sh
Jiahao XU 9874dca454
Fix bin names in .crates.toml on win (#802)
`bins::BinFile::new` does not include `binary_ext` in the
`BinFile::base_name`.

Also add regression e2e-test.

Fixed #801

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
2023-02-15 17:24:50 +13:00

17 lines
427 B
Bash

#!/bin/bash
set -euxo pipefail
unset CARGO_INSTALL_ROOT
export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t '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/"
cargo binstall --no-confirm cargo-watch
cargo uninstall cargo-watch