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

- Refactor: Extract new fn `binstalk::helpers::remote::does_url_exist` - Use new quickinstall release schema in `binstalk::fetchers::QuickInstall` - Optimize `fetchers::QuickInstall`: Generate url once in `Fetcher::new` Avoid repeated string allocation plus `Url` parsing. This also makes changing package_url and stats_url easier. - Optimize `QuickInstall::report`: Use HEAD instead of GET Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
17 lines
736 B
Bash
Executable file
17 lines
736 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -euxo pipefail
|
|
|
|
unset CARGO_INSTALL_ROOT
|
|
|
|
export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')
|
|
export PATH="$CARGO_HOME/bin:$PATH"
|
|
|
|
# Test skip when installed
|
|
"./$1" binstall --no-confirm --force cargo-binstall@0.11.1
|
|
"./$1" binstall --log-level=info --no-confirm cargo-binstall@0.11.1 | grep -q 'cargo-binstall v0.11.1 is already installed'
|
|
|
|
## Test When 0.11.0 is installed but can be upgraded.
|
|
"./$1" binstall --no-confirm cargo-binstall@0.12.0
|
|
"./$1" binstall --log-level=info --no-confirm cargo-binstall@0.12.0 | grep -q 'cargo-binstall v0.12.0 is already installed'
|
|
"./$1" binstall --log-level=info --no-confirm cargo-binstall@^0.12.0 | grep -q -v 'cargo-binstall v0.12.0 is already installed'
|