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>
This commit is contained in:
Jiahao XU 2023-02-15 15:24:50 +11:00 committed by GitHub
parent 30f7722131
commit 9874dca454
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 3 deletions

17
e2e-tests/uninstall.sh Normal file
View file

@ -0,0 +1,17 @@
#!/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