Support cargo-binstall fallback without cargo

This commit is contained in:
Taiki Endo
2024-06-02 01:08:59 +09:00
parent e5240ce0c5
commit 2d4372270d
5 changed files with 20 additions and 50 deletions

View File

@@ -128,17 +128,14 @@ case "${host_os}" in
fi
;;
esac
# cargo-binstall requires cargo
if type -P cargo &>/dev/null; then
# cargo-watch/watchexec-cli is supported by cargo-binstall (through quickinstall)
case "${version}" in
latest) tools+=(cargo-watch watchexec-cli nextest) ;;
major.minor.patch) tools+=(cargo-watch@8.1.1 watchexec-cli@1.20.5 nextest@0.9.57) ;;
major.minor) tools+=(cargo-watch@8.1 watchexec-cli@1.20 nextest@0.9) ;;
major) tools+=(cargo-watch@8 watchexec-cli@1) ;;
*) exit 1 ;;
esac
fi
# cargo-watch/watchexec-cli is supported by cargo-binstall (through quickinstall)
case "${version}" in
latest) tools+=(cargo-watch watchexec-cli nextest) ;;
major.minor.patch) tools+=(cargo-watch@8.1.1 watchexec-cli@1.20.5 nextest@0.9.57) ;;
major.minor) tools+=(cargo-watch@8.1 watchexec-cli@1.20 nextest@0.9) ;;
major) tools+=(cargo-watch@8 watchexec-cli@1) ;;
*) exit 1 ;;
esac
# sort and dedup
IFS=$'\n'