Skip to content

Commit

Permalink
Don't prompt for libc type when not on Linux
Browse files Browse the repository at this point in the history
Currently, Darwin users are prompted for the libc type. This shouldn't
be happening. Only Linux users should get prompted.

Closes #178
  • Loading branch information
SeanTAllen committed Mar 19, 2021
1 parent 8c33d45 commit a75af59
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .release-notes/179.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Fix confusing and seemingly broken installation on MacOS

MacOS installation looked like it was failing because it prompted for a libc version to install forcing the user to select "cancel" as the option. Ponyup was actually installed correctly, but the end user had no way of knowing.
53 changes: 28 additions & 25 deletions ponyup-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,31 +191,34 @@ if ! echo "$PATH" | grep -q "${ponyup_root}/bin"; then
esac
fi

if [ "${platform_triple_distro}" = "" ]; then
while true; do
echo "Unable to determine libc type. Pease select one of the following:"
echo "1) glibc"
echo "2) musl"
echo "3) cancel"
printf "selection: "
read -r selection
case ${selection} in
1 | glibc)
platform_triple_distro="gnu"
break
;;
2 | musl)
platform_triple_distro="musl"
break
;;
3 | cancel)
exit 1
;;
*) ;;
esac
done
platform_triple="${platform_triple}-${platform_triple_distro}"
fi
case "${uname_s}" in
Linux*)
if [ "${platform_triple_distro}" = "" ]; then
while true; do
echo "Unable to determine libc type. Please select one of the following:"
echo "1) glibc"
echo "2) musl"
echo "3) cancel"
printf "selection: "
read -r selection
case ${selection} in
1 | glibc)
platform_triple_distro="gnu"
break
;;
2 | musl)
platform_triple_distro="musl"
break
;;
3 | cancel)
exit 1
;;
*) ;;
esac
done
platform_triple="${platform_triple}-${platform_triple_distro}"
fi
esac

printf "%bsetting default platform to %b${platform_triple}%b\n" \
"${BLUE}" "${YELLOW}" "${DEFAULT}"
Expand Down

0 comments on commit a75af59

Please sign in to comment.