From a75af59286e6fc49d7c2eb7bfd8a3ad625dc5b4f Mon Sep 17 00:00:00 2001 From: "Sean T. Allen" Date: Thu, 18 Mar 2021 19:57:46 -0400 Subject: [PATCH] Don't prompt for libc type when not on Linux Currently, Darwin users are prompted for the libc type. This shouldn't be happening. Only Linux users should get prompted. Closes #178 --- .release-notes/179.md | 3 +++ ponyup-init.sh | 53 +++++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 25 deletions(-) create mode 100644 .release-notes/179.md diff --git a/.release-notes/179.md b/.release-notes/179.md new file mode 100644 index 0000000..cc75602 --- /dev/null +++ b/.release-notes/179.md @@ -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. diff --git a/ponyup-init.sh b/ponyup-init.sh index e273bce..989a1ac 100755 --- a/ponyup-init.sh +++ b/ponyup-init.sh @@ -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}"