diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..4de267d --- /dev/null +++ b/install.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail + +put() { + echo -e "\e[1;32m$1\e[0m" +} + +do_install() { + cat <<'EOM' + + ______ _____ _ _ _ + | ____| |_ _| | | | | | + | |____ __ | | _ __ ___| |_ __ _| | | ___ _ __ + | __\ \/ / | | | '_ \/ __| __/ _` | | |/ _ \ '__| + | | > < _| |_| | | \__ \ || (_| | | | __/ | + |_| /_/\_\ |_____|_| |_|___/\__\__,_|_|_|\___|_| + +EOM + + platform='' + if [[ "$OSTYPE" == "linux"* ]]; then + platform='linux' + elif [[ "$OSTYPE" == "darwin"* ]]; then + platform='macos' + elif [[ "$OSTYPE" == "win"* ]]; then + platform='win.exe' + fi + + if test "x$platform" = "x"; then + cat < "fx-$platform.zip" + + put "Extracting fx-$platform.zip" + unzip "fx-$platform.zip" + rm "fx-$platform.zip" + mv "fx-$platform" fx + + name='' + read -p $'\e[1;35mWhould you like to move fx binary to /usr/local/bin?\e[0m [Y/n] ' -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + mv fx /usr/local/bin/fx + name='fx' + else + name='./fx' + fi + + cat <