Commit 0dc24b56 authored by Leo Iannacone's avatar Leo Iannacone

scripts: shellcheck compliance for install.sh

parent e04f6c70
...@@ -10,13 +10,13 @@ get_github() { ...@@ -10,13 +10,13 @@ get_github() {
ARCHIVE=v${VERSION}.zip ARCHIVE=v${VERSION}.zip
URL="https://github.com/${USER}/${NAME}/archive/${ARCHIVE}" URL="https://github.com/${USER}/${NAME}/archive/${ARCHIVE}"
LIB_NAME="${NAME}-${VERSION}" LIB_NAME="${NAME}-${VERSION}"
if [ -d ${EXT_LIBS_DIR}/${LIB_NAME} ] ; then return ; fi if [ -d "${EXT_LIBS_DIR}/${LIB_NAME}" ] ; then return ; fi
echo "Downloading ${NAME} ${VERSION} ..." echo "Downloading ${NAME} ${VERSION} ..."
curl -s -O -L ${URL} && \ curl -s -O -L "${URL}" && \
unzip -q ${ARCHIVE} && rm ${ARCHIVE} unzip -q "${ARCHIVE}" && rm "${ARCHIVE}"
if [ "$DIST" != "" ] ; then if [ "${DIST}" != "" ] ; then
mv ${LIB_NAME} tmp mv "${LIB_NAME}" tmp
mv tmp/${DIST} ${LIB_NAME} mv "tmp/${DIST}" "${LIB_NAME}"
rm -r tmp rm -r tmp
fi fi
} }
...@@ -24,7 +24,7 @@ get_github() { ...@@ -24,7 +24,7 @@ get_github() {
get_bootstrap() { get_bootstrap() {
VERSION="3.2.0" VERSION="3.2.0"
NAME="bootstrap-${VERSION}-dist" NAME="bootstrap-${VERSION}-dist"
if [ -d ${EXT_LIBS_DIR}/${NAME} ] ; then return ; fi if [ -d "${EXT_LIBS_DIR}/${NAME}" ] ; then return ; fi
ARCHIVE=${NAME}.zip ARCHIVE=${NAME}.zip
URL="https://github.com/twbs/bootstrap/releases/download/v${VERSION}/${ARCHIVE}" URL="https://github.com/twbs/bootstrap/releases/download/v${VERSION}/${ARCHIVE}"
echo "Downloading bootstrap ${VERSION} ..." echo "Downloading bootstrap ${VERSION} ..."
...@@ -35,7 +35,7 @@ get_bootstrap() { ...@@ -35,7 +35,7 @@ get_bootstrap() {
get_jquery() { get_jquery() {
VERSION="1.11.0" VERSION="1.11.0"
DIR_JQUERY="jquery" DIR_JQUERY="jquery"
if [ -d ${EXT_LIBS_DIR}/${DIR_JQUERY} ] ; then return ; fi if [ -d "${EXT_LIBS_DIR}/${DIR_JQUERY}" ] ; then return ; fi
mkdir ${DIR_JQUERY} mkdir ${DIR_JQUERY}
cd ${DIR_JQUERY} cd ${DIR_JQUERY}
URL="http://code.jquery.com/jquery-${VERSION}.min.js" URL="http://code.jquery.com/jquery-${VERSION}.min.js"
...@@ -47,7 +47,7 @@ get_jquery() { ...@@ -47,7 +47,7 @@ get_jquery() {
get_tablesorter() { get_tablesorter() {
VERSION="2.17.8" VERSION="2.17.8"
DIR_TABLESORTER="tablesorter" DIR_TABLESORTER="tablesorter"
if [ -d ${EXT_LIBS_DIR}/${DIR_TABLESORTER} ] ; then return ; fi if [ -d "${EXT_LIBS_DIR}/${DIR_TABLESORTER}" ] ; then return ; fi
mkdir ${DIR_TABLESORTER} mkdir ${DIR_TABLESORTER}
cd ${DIR_TABLESORTER} cd ${DIR_TABLESORTER}
echo "Downloading tablesorter ..." echo "Downloading tablesorter ..."
...@@ -58,10 +58,10 @@ get_tablesorter() { ...@@ -58,10 +58,10 @@ get_tablesorter() {
cd .. cd ..
} }
if [ ! -d ${EXT_LIBS_DIR} ] ; then mkdir -p ${EXT_LIBS_DIR} ; fi if [ ! -d "${EXT_LIBS_DIR}" ] ; then mkdir -p "${EXT_LIBS_DIR}" ; fi
TMP_DIR="`mktemp -d`" TMP_DIR="$(mktemp -d)"
cd ${TMP_DIR} cd "${TMP_DIR}"
get_jquery get_jquery
get_tablesorter get_tablesorter
...@@ -72,5 +72,5 @@ get_github "twbs" "bootstrap" "3.2.0" "dist" ...@@ -72,5 +72,5 @@ get_github "twbs" "bootstrap" "3.2.0" "dist"
# get chartist # get chartist
get_github "gionkunz" "chartist-js" "0.7.2" "dist" get_github "gionkunz" "chartist-js" "0.7.2" "dist"
if [ "`ls -1`" != "" ] ; then mv * ${EXT_LIBS_DIR} ; fi if [ "$(ls -1)" != "" ] ; then mv ./* "${EXT_LIBS_DIR}" ; fi
cd && rm -r ${TMP_DIR} cd && rm -r "${TMP_DIR}"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment