mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +00:00
32 lines
961 B
Bash
32 lines
961 B
Bash
#!/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"
|
|
|
|
# first boostrap-install into the CARGO_HOME
|
|
mkdir -p "$CARGO_HOME/bin"
|
|
cp "./$1" "$CARGO_HOME/bin"
|
|
|
|
# now we're running the CARGO_HOME/bin/cargo-binstall (via cargo):
|
|
|
|
# self update replacing no-symlinks with no-symlinks
|
|
cargo binstall --no-confirm --no-symlinks --force cargo-binstall@0.20.1
|
|
|
|
# self update replacing no-symlinks with symlinks
|
|
cp "./$1" "$CARGO_HOME/bin"
|
|
|
|
cargo binstall --no-confirm --force cargo-binstall@0.20.1
|
|
|
|
# self update replacing symlinks with symlinks
|
|
ln -snf "$(pwd)/cargo-binstall" "$CARGO_HOME/bin/cargo-binstall"
|
|
|
|
cargo binstall --no-confirm --force cargo-binstall@0.20.1
|
|
|
|
# self update replacing symlinks with no-symlinks
|
|
ln -snf "$(pwd)/cargo-binstall" "$CARGO_HOME/bin/cargo-binstall"
|
|
|
|
cargo binstall --no-confirm --force --no-symlinks cargo-binstall@0.20.1
|