mirror of
https://github.com/taiki-e/install-action.git
synced 2026-05-10 22:50:32 +00: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() {
|
install_cargo_binstall() {
|
||||||
# https://github.com/cargo-bins/cargo-binstall/releases
|
# https://github.com/cargo-bins/cargo-binstall/releases
|
||||||
binstall_version="0.17.0"
|
local binstall_version="0.17.0"
|
||||||
install_binstall='1'
|
local install_binstall='1'
|
||||||
if [[ -f "${cargo_bin}/cargo-binstall${exe}" ]]; then
|
if [[ -f "${cargo_bin}/cargo-binstall${exe}" ]]; then
|
||||||
if [[ "$(cargo binstall -V)" == "cargo-binstall ${binstall_version}" ]]; then
|
if [[ "$(cargo binstall -V)" == "cargo-binstall ${binstall_version}" ]]; then
|
||||||
info "cargo-binstall already installed on in ${cargo_bin}/cargo-binstall${exe}"
|
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
|
cargo_bin=/usr/local/bin
|
||||||
fi
|
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
|
for tool in "${tools[@]}"; do
|
||||||
if [[ "${tool}" == *"@"* ]]; then
|
if [[ "${tool}" == *"@"* ]]; then
|
||||||
version="${tool#*@}"
|
version="${tool#*@}"
|
||||||
@@ -290,9 +300,8 @@ for tool in "${tools[@]}"; do
|
|||||||
# https://nexte.st/book/pre-built-binaries.html
|
# https://nexte.st/book/pre-built-binaries.html
|
||||||
case "${OSTYPE}" in
|
case "${OSTYPE}" in
|
||||||
linux*)
|
linux*)
|
||||||
host_triple
|
case "${host_env}" in
|
||||||
case "${host}" in
|
gnu) url="https://get.nexte.st/${version}/linux" ;;
|
||||||
*-linux-gnu*) url="https://get.nexte.st/${version}/linux" ;;
|
|
||||||
*) url="https://get.nexte.st/${version}/linux-musl" ;;
|
*) url="https://get.nexte.st/${version}/linux-musl" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user