Last active
May 5, 2020 21:36
-
-
Save loic-roux-404/e9b972dc0d933c8645dc796aaf29a7d3 to your computer and use it in GitHub Desktop.
manala fixed install script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
CURL=$(which curl) | |
if [ "$?" = "1" ]; then | |
echo "You need curl to use this script." | |
exit 1 | |
fi | |
VERSION=$(curl -sI https://github.com/manala/manala/releases/latest | grep location | awk -F"/" '{ printf "%s", $NF }' | tr -d '\r') | |
if [ ! ${VERSION} ]; then | |
echo "Failed while attempting to install manala. Please manually install:" | |
echo "" | |
echo "1. Open your web browser and go to https://github.com/nervo/manala/releases" | |
echo "2. Download the latest release for your platform. Call it 'manala'." | |
echo "3. chmod +x ./manala" | |
echo "4. mv ./manala /usr/local/bin" | |
exit 1 | |
fi | |
HAS=$(which manala) | |
if [ "$?" = "0" ]; then | |
echo | |
echo "You already have manala!" | |
export N=3 | |
echo "Overwriting in ${N} seconds.. Press Control+C to cancel." | |
echo | |
sleep ${N} | |
fi | |
case $(uname) in | |
"Darwin") | |
OS="darwin" | |
ARCH="amd64" | |
;; | |
"Linux") | |
OS="linux" | |
ARCH="amd64" | |
;; | |
esac | |
URL=https://github.com/nervo/manala/releases/download/${VERSION}/manala_${OS}_${ARCH} | |
DST=/usr/local/bin/manala | |
echo "Downloading package ${URL} as ${DST}" | |
curl -sSL ${URL} --output ${DST} | |
chmod +x ${DST} | |
echo "Download complete, happy manaling!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment