From 54f3e22932fb6d414a4fa336f1194af54ded8694 Mon Sep 17 00:00:00 2001 From: mollusk Date: Wed, 29 May 2019 09:59:50 -0700 Subject: [PATCH] Remove: Gohunt, fix crystal-installer.sh Former-commit-id: fa3004fcb34397748e0fb831c4349c609f8f2a86 --- Gohunt.sh | 48 -------------------------------------------- crystal-installer.sh | 27 +++++++++++++++---------- 2 files changed, 16 insertions(+), 59 deletions(-) delete mode 100644 Gohunt.sh diff --git a/Gohunt.sh b/Gohunt.sh deleted file mode 100644 index 3bac5b8..0000000 --- a/Gohunt.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash -# Colors -RED='\033[0;31m' -LRED="\033[1;31m" -BLUE="\033[0;34m" -LBLUE="\033[1;34m" -GREEN="\033[0;32m" -LGREEN="\033[1;32m" -YELLOW="\033[1;33m" -CYAN="\033[0;36m" -LCYAN="\033[1;36m" -PURPLE="\033[0;35m" -LPURPLE="\033[1;35m" -BWHITE="\e[1m" -NC='\033[0m' # No Color -############################## - -createGopath(){ - echo -e "\nYour GOPATH is not set, should we set it now?: " - read choice - - if [ "${choice}" = "y" ] || [ "${choice}" = "Y" ];then - echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc - if grep -Fx "${gPATH}" ~/.bashrc;then - echo -e "${LGREEN}\nGOPATH is set in bashrc\n${NC}" - else - echo -e "\nPlease set the GOPATH in .bashrc\n\n" - echo -e "\n'\nexport PATH=$PATH:/usr/local/go/bin'\n" - fi - else - echo "\n" - - -} - -checkPath(){ - gPATH='export PATH=$PATH:/usr/local/go/bin' - if grep -Fx "${gPATH}" ~/.bashrc;then - echo -e "${LGREEN}\nGOPATH is set in bashrc\n${NC}" - else - createGopath - - -} - -checkDir(){ - if [ ! -d ${GOPATH}] -} \ No newline at end of file diff --git a/crystal-installer.sh b/crystal-installer.sh index 21ddb14..60d060f 100755 --- a/crystal-installer.sh +++ b/crystal-installer.sh @@ -1,34 +1,39 @@ #!/bin/bash NAME="crystal" -VERSION="0.22.0-1" +VERSION="0.28.0" +REV="1" ARCH="x86_64" PREFIX="/usr" TMP="/tmp" -URL="https://github.com/crystal-lang/crystal/releases/download/0.22.0/${NAME}-${VERSION}-linux-${ARCH}.tar.gz" +URL="https://github.com/crystal-lang/crystal/releases/download/${VERSION}/${NAME}-${VERSION}-${REV}-linux-${ARCH}.tar.gz" download_(){ - printf "Downloading ${NAME}-${VERSION}-${ARCH}...\n" - wget ${URL} -P ${TMP} + if [ ! -f ${TMP}/${NAME}-${VERSION}-${REV}-linux-${ARCH}.tar.gz ];then + printf "Downloading ${NAME}-${VERSION}-${ARCH}...\n" + wget ${URL} -P ${TMP} + + else + echo "${NAME}-${VERSION}-${REV}-linux-${ARCH}tar.gz" exists + fi } extract_(){ printf "Ectracting archive file to ${TMP}...\n" cd ${TMP} - tar xvf ${NAME}-${VERSION}-linux-${ARCH}tar.gz + tar -xzvf ${NAME}-${VERSION}-${REV}-linux-${ARCH}.tar.gz } install_(){ printf "Copying files to system..\n" - cd ${TMP}/${NAME}-${VERSION}/embedded - cp -r {bin,include,lib,share} ${PREFIX}/ + cd ${TMP}/${NAME}-${VERSION}-${REV} + cp -r {bin,lib,share} ${PREFIX}/ } -link_(){ - -} - +download_ +extract_ +install_