Updating install.sh

This commit is contained in:
João M. Bezerra 2021-05-30 23:38:32 -03:00
parent 62a4fe695d
commit f952392c34

View File

@ -7,29 +7,30 @@ DOWNLOAD_LOCATION="/tmp/ouch"
INSTALLATION_LOCATION="/usr/bin/ouch" INSTALLATION_LOCATION="/usr/bin/ouch"
REPO_URL="https://github.com/vrmiguel/ouch" REPO_URL="https://github.com/vrmiguel/ouch"
# Panicks script if anything fails
set -e
abort() { abort() {
echo "error occurred, aborting." ; exit 1 echo "error occurred, aborting." ; exit 1
} }
# Panicks script if anything fails install() {
set -e
echo "Ouch v$VERSION." echo "Ouch v$VERSION."
printf "Detected system: " printf "Detected system: "
# System detection from https://stackoverflow.com/a/27776822/9982477 # System detection from https://stackoverflow.com/a/27776822/9982477
# Go there to see a full table of what `uname -s` might output # Go there to see a full table of what `uname -s` might output
case "$(uname -s)" in case "$(uname -s)" in
Darwin)
system_suffix="-macOS"
echo "Mac OS X."
;;
Linux) Linux)
echo "Linux." echo "Linux."
system_suffix="-ubuntu-18.04-glibc" system_suffix="-ubuntu-18.04-glibc"
;; ;;
Darwin)
echo "Mac OS X."
system_suffix="-macOS"
;;
CYGWIN*|MINGW32*|MSYS*|MINGW*) CYGWIN*|MINGW32*|MSYS*|MINGW*)
echo "Windows." echo "Windows."
system_suffix=".exe" system_suffix=".exe"
@ -76,3 +77,6 @@ echo ""
echo "Successfully installed!" echo "Successfully installed!"
echo "See $REPO_URL for usage instructions." echo "See $REPO_URL for usage instructions."
}
install