Remove: Gohunt, fix crystal-installer.sh
Former-commit-id: fa3004fcb34397748e0fb831c4349c609f8f2a86
This commit is contained in:
parent
b3d62df3c0
commit
54f3e22932
48
Gohunt.sh
48
Gohunt.sh
@ -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}]
|
|
||||||
}
|
|
@ -1,34 +1,39 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
NAME="crystal"
|
NAME="crystal"
|
||||||
VERSION="0.22.0-1"
|
VERSION="0.28.0"
|
||||||
|
REV="1"
|
||||||
ARCH="x86_64"
|
ARCH="x86_64"
|
||||||
PREFIX="/usr"
|
PREFIX="/usr"
|
||||||
TMP="/tmp"
|
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_(){
|
download_(){
|
||||||
|
if [ ! -f ${TMP}/${NAME}-${VERSION}-${REV}-linux-${ARCH}.tar.gz ];then
|
||||||
printf "Downloading ${NAME}-${VERSION}-${ARCH}...\n"
|
printf "Downloading ${NAME}-${VERSION}-${ARCH}...\n"
|
||||||
wget ${URL} -P ${TMP}
|
wget ${URL} -P ${TMP}
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "${NAME}-${VERSION}-${REV}-linux-${ARCH}tar.gz" exists
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_(){
|
extract_(){
|
||||||
printf "Ectracting archive file to ${TMP}...\n"
|
printf "Ectracting archive file to ${TMP}...\n"
|
||||||
cd ${TMP}
|
cd ${TMP}
|
||||||
tar xvf ${NAME}-${VERSION}-linux-${ARCH}tar.gz
|
tar -xzvf ${NAME}-${VERSION}-${REV}-linux-${ARCH}.tar.gz
|
||||||
}
|
}
|
||||||
|
|
||||||
install_(){
|
install_(){
|
||||||
printf "Copying files to system..\n"
|
printf "Copying files to system..\n"
|
||||||
cd ${TMP}/${NAME}-${VERSION}/embedded
|
cd ${TMP}/${NAME}-${VERSION}-${REV}
|
||||||
cp -r {bin,include,lib,share} ${PREFIX}/
|
cp -r {bin,lib,share} ${PREFIX}/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
link_(){
|
download_
|
||||||
|
extract_
|
||||||
}
|
install_
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user