Skip to content

Commit

Permalink
Install figlet with Homebrew on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ron.record committed Jun 10, 2024
1 parent 07cb787 commit 5f6f0e8
Showing 1 changed file with 26 additions and 17 deletions.
43 changes: 26 additions & 17 deletions etc/install-figlet
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,33 @@ export PATH

have_figlet=$(type -p figlet)
[ "${have_figlet}" ] || {
have_make=$(type -p make)
if [ "${have_make}" ]; then
printf "\nInstalling figlet\n"
uid=$(id -u)
SUDO="sudo"
if [ "${EUID}" ]; then
[ ${EUID} -eq 0 ] && SUDO=
darwin=
platform=$(uname -s)
[ "${platform}" == "Darwin" ] && darwin=1
have_brew=$(type -p brew)
if [ "${have_brew}" ] && [ "${darwin}" ]; then
printf "\nInstalling figlet with Homebrew\n"
brew install figlet >/dev/null 2>&1
else
have_make=$(type -p make)
if [ "${have_make}" ]; then
printf "\nInstalling figlet\n"
uid=$(id -u)
SUDO="sudo"
if [ "${EUID}" ]; then
[ ${EUID} -eq 0 ] && SUDO=
else
[ ${uid} -eq 0 ] && SUDO=
fi
HERE=$(pwd)
git clone https://github.com/cmatsuoka/figlet /tmp/figlet$$ > /dev/null 2>&1
cd /tmp/figlet$$
${SUDO} make install > /dev/null 2>&1
cd "${HERE}"
${SUDO} rm -rf /tmp/figlet$$
else
[ ${uid} -eq 0 ] && SUDO=
printf "\nInstallation of figlet requires 'make' but 'make' not found."
printf "\nInstall 'make' and try again. Skipping installation of figlet.\n"
fi
HERE=$(pwd)
git clone https://github.com/cmatsuoka/figlet /tmp/figlet$$ > /dev/null 2>&1
cd /tmp/figlet$$
${SUDO} make install > /dev/null 2>&1
cd "${HERE}"
${SUDO} rm -rf /tmp/figlet$$
else
printf "\nInstallation of figlet requires 'make' but 'make' not found."
printf "\nInstall 'make' and try again. Skipping installation of figlet.\n"
fi
}

0 comments on commit 5f6f0e8

Please sign in to comment.