mirror of
https://github.com/taiki-e/install-action.git
synced 2026-04-09 18:11:48 +08:00
Adjust host env check
This commit is contained in:
19
main.sh
19
main.sh
@@ -80,8 +80,8 @@ host_triple() {
|
||||
}
|
||||
install_cargo_binstall() {
|
||||
# https://github.com/cargo-bins/cargo-binstall/releases
|
||||
binstall_version="0.17.0"
|
||||
install_binstall='1'
|
||||
local binstall_version="0.17.0"
|
||||
local install_binstall='1'
|
||||
if [[ -f "${cargo_bin}/cargo-binstall${exe}" ]]; then
|
||||
if [[ "$(cargo binstall -V)" == "cargo-binstall ${binstall_version}" ]]; then
|
||||
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall${exe}"
|
||||
@@ -161,6 +161,16 @@ if [[ ! -d "${cargo_bin}" ]]; then
|
||||
cargo_bin=/usr/local/bin
|
||||
fi
|
||||
|
||||
# Refs: https://github.com/rust-lang/rustup/blob/HEAD/rustup-init.sh
|
||||
case "${OSTYPE}" in
|
||||
linux*)
|
||||
host_env="gnu"
|
||||
if ldd --version 2>&1 | grep -q 'musl'; then
|
||||
host_env="musl"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for tool in "${tools[@]}"; do
|
||||
if [[ "${tool}" == *"@"* ]]; then
|
||||
version="${tool#*@}"
|
||||
@@ -290,9 +300,8 @@ for tool in "${tools[@]}"; do
|
||||
# https://nexte.st/book/pre-built-binaries.html
|
||||
case "${OSTYPE}" in
|
||||
linux*)
|
||||
host_triple
|
||||
case "${host}" in
|
||||
*-linux-gnu*) url="https://get.nexte.st/${version}/linux" ;;
|
||||
case "${host_env}" in
|
||||
gnu) url="https://get.nexte.st/${version}/linux" ;;
|
||||
*) url="https://get.nexte.st/${version}/linux-musl" ;;
|
||||
esac
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user