jitty-scripts/crystal-installer.sh
mollusk 54f3e22932 Remove: Gohunt, fix crystal-installer.sh
Former-commit-id: fa3004fcb34397748e0fb831c4349c609f8f2a86
2019-05-29 09:59:50 -07:00

40 lines
783 B
Bash
Executable File

#!/bin/bash
NAME="crystal"
VERSION="0.28.0"
REV="1"
ARCH="x86_64"
PREFIX="/usr"
TMP="/tmp"
URL="https://github.com/crystal-lang/crystal/releases/download/${VERSION}/${NAME}-${VERSION}-${REV}-linux-${ARCH}.tar.gz"
download_(){
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 -xzvf ${NAME}-${VERSION}-${REV}-linux-${ARCH}.tar.gz
}
install_(){
printf "Copying files to system..\n"
cd ${TMP}/${NAME}-${VERSION}-${REV}
cp -r {bin,lib,share} ${PREFIX}/
}
download_
extract_
install_