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

scripts: shellcheck compliance for install.sh

parent e04f6c70
......@@ -10,13 +10,13 @@ get_github() {
ARCHIVE=v${VERSION}.zip
URL="https://github.com/${USER}/${NAME}/archive/${ARCHIVE}"
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} ..."
curl -s -O -L ${URL} && \
unzip -q ${ARCHIVE} && rm ${ARCHIVE}
if [ "$DIST" != "" ] ; then
mv ${LIB_NAME} tmp
mv tmp/${DIST} ${LIB_NAME}
curl -s -O -L "${URL}" && \
unzip -q "${ARCHIVE}" && rm "${ARCHIVE}"
if [ "${DIST}" != "" ] ; then
mv "${LIB_NAME}" tmp
mv "tmp/${DIST}" "${LIB_NAME}"
rm -r tmp
fi
}
......@@ -24,7 +24,7 @@ get_github() {
get_bootstrap() {
VERSION="3.2.0"
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
URL="https://github.com/twbs/bootstrap/releases/download/v${VERSION}/${ARCHIVE}"
echo "Downloading bootstrap ${VERSION} ..."
......@@ -35,7 +35,7 @@ get_bootstrap() {
get_jquery() {
VERSION="1.11.0"
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}
cd ${DIR_JQUERY}
URL="http://code.jquery.com/jquery-${VERSION}.min.js"
......@@ -47,7 +47,7 @@ get_jquery() {
get_tablesorter() {
VERSION="2.17.8"
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}
cd ${DIR_TABLESORTER}
echo "Downloading tablesorter ..."
......@@ -58,10 +58,10 @@ get_tablesorter() {
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`"
cd ${TMP_DIR}
TMP_DIR="$(mktemp -d)"
cd "${TMP_DIR}"
get_jquery
get_tablesorter
......@@ -72,5 +72,5 @@ get_github "twbs" "bootstrap" "3.2.0" "dist"
# get chartist
get_github "gionkunz" "chartist-js" "0.7.2" "dist"
if [ "`ls -1`" != "" ] ; then mv * ${EXT_LIBS_DIR} ; fi
cd && rm -r ${TMP_DIR}
if [ "$(ls -1)" != "" ] ; then mv ./* "${EXT_LIBS_DIR}" ; fi
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