Install Rust-related binaries to /usr/local/bin when cargo home is not available

This commit is contained in:
Taiki Endo
2022-07-25 20:00:53 +09:00
parent 36cb23f9a6
commit 8aa291abce
3 changed files with 20 additions and 15 deletions

View File

@@ -129,9 +129,9 @@ case "${OSTYPE}" in
esac
cargo_bin="${CARGO_HOME:-"$HOME/.cargo"}/bin"
mkdir -p "${cargo_bin}"
# For version check. It is intentional that this is not wrote in GITHUB_ENV.
export PATH="${cargo_bin}:$PATH"
if [[ ! -d "${cargo_bin}" ]]; then
cargo_bin=/usr/local/bin
fi
for tool in "${tools[@]}"; do
if [[ "${tool}" == *"@"* ]]; then