From 5283f16dc1dcff444f550ac8d295fd1cccbe2433 Mon Sep 17 00:00:00 2001
From: Akira Ohgaki <akiraohgaki@gmail.com>
Date: Sun, 18 Feb 2018 22:24:20 +0900
Subject: [PATCH] Fix bash scripts

---
 scripts/package.sh | 6 +++---
 scripts/prepare.sh | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/package.sh b/scripts/package.sh
index 6df36ab..f6e3705 100644
--- a/scripts/package.sh
+++ b/scripts/package.sh
@@ -46,13 +46,13 @@ build_appimage() {
 }
 
 export_srcarchive() {
-    if [ "${1}" ]; then
+    if [[ "${1}" ]]; then
         $(cd "${PROJDIR}" && git archive --prefix="${PKGNAME}/" --output="${1}" HEAD)
     fi
 }
 
 transfer_file() {
-    if [ -f "${1}" ]; then
+    if [[ -f "${1}" ]]; then
         filename="$(basename "${1}")"
         transferlog="${PROJDIR}/transfer.log"
         echo "Uploading ${filename}" >> "${transferlog}"
@@ -61,6 +61,6 @@ transfer_file() {
     fi
 }
 
-if [ "${1}" ]; then
+if [[ "${1}" = 'ci_'* || "${1}" = 'build_'* ]]; then
     ${1}
 fi
diff --git a/scripts/prepare.sh b/scripts/prepare.sh
index 433a622..631b96c 100644
--- a/scripts/prepare.sh
+++ b/scripts/prepare.sh
@@ -2,16 +2,16 @@
 
 PROJDIR="$(cd "$(dirname "${0}")/../" && pwd)"
 
-if [ ! -d "${PROJDIR}/lib/qtil" ]; then
+if [[ ! -d "${PROJDIR}/lib/qtil" ]]; then
     git clone https://github.com/akiraohgaki/qtil.git -b release-0.3.0 --single-branch --depth=1 "${PROJDIR}/lib/qtil"
 fi
 
-if [ ! -d "${PROJDIR}/lib/AppImageUpdate" ]; then
+if [[ ! -d "${PROJDIR}/lib/AppImageUpdate" ]]; then
     git clone https://github.com/AppImage/AppImageUpdate.git -b continuous --single-branch --depth=1 "${PROJDIR}/lib/AppImageUpdate"
     git -C "${PROJDIR}/lib/AppImageUpdate" submodule update --init --recursive #--depth=1
 fi
 
-if [ ! -d "${PROJDIR}/lib/AppImageUpdate-prebuilt" ]; then
+if [[ ! -d "${PROJDIR}/lib/AppImageUpdate-prebuilt" ]]; then
     mkdir "${PROJDIR}/lib/AppImageUpdate-prebuilt"
     cd "${PROJDIR}/lib/AppImageUpdate-prebuilt"
     cmake "${PROJDIR}/lib/AppImageUpdate" -DUSE_SYSTEM_CURL=ON -DBUILD_CPR_TESTS=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo
-- 
GitLab