Skip to content

Commit

Permalink
Support adding targets if build-tool is explicitly set to cargo (#57)
Browse files Browse the repository at this point in the history
If build-tool was explicitly set to cargo, this code wasn't running
earlier.
  • Loading branch information
sunshowers authored Oct 23, 2023
1 parent 2868fa8 commit b7a8e68
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,6 @@ target_upper=$(tr '[:lower:]' '[:upper:]' <<<"${target_lower}")
if [[ -z "${build_tool}" ]]; then
build_tool="cargo"
if [[ "${host}" != "${target}" ]]; then
case "${target}" in
universal-apple-darwin) x rustup target add aarch64-apple-darwin x86_64-apple-darwin ;;
*) x rustup target add "${target}" ;;
esac
case "${target}" in
# https://github.com/cross-rs/cross#supported-targets
*-windows-msvc* | *-windows-gnu* | *-darwin* | *-fuchsia* | *-redox*) ;;
Expand All @@ -184,6 +180,14 @@ if [[ -z "${build_tool}" ]]; then
esac
fi
fi

if [[ "${build_tool}" == "cargo" ]]; then
case "${target}" in
universal-apple-darwin) x rustup target add aarch64-apple-darwin x86_64-apple-darwin ;;
*) x rustup target add "${target}" ;;
esac
fi

archive="${archive/\$bin/${bin_names[0]}}"
archive="${archive/\$target/${target}}"
archive="${archive/\$tag/${tag}}"
Expand Down

0 comments on commit b7a8e68

Please sign in to comment.