summary refs log tree commit diff
path: root/.ci/script.sh
diff options
context:
space:
mode:
authorzapashcanon <leo@ndrs.fr>2019-04-24 01:55:05 +0200
committerzapashcanon <leo@ndrs.fr>2019-04-24 01:55:05 +0200
commiteee6f2de31bb01bda96597a5236fc4b2dc668ff4 (patch)
treecdbf798b78024df70262971c6858d1342ea8d019 /.ci/script.sh
parentUpdate olm repo to new location. (diff)
downloadnheko-eee6f2de31bb01bda96597a5236fc4b2dc668ff4.tar.xz
improve shell scripts and update .gitignore
Diffstat (limited to '.ci/script.sh')
-rwxr-xr-x.ci/script.sh29
1 files changed, 15 insertions, 14 deletions
diff --git a/.ci/script.sh b/.ci/script.sh
index 435f2c27..2d5cc49b 100755
--- a/.ci/script.sh
+++ b/.ci/script.sh
@@ -1,31 +1,32 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
 
-set -ex
+set -eux
 
-if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+if [ "$TRAVIS_OS_NAME" = "linux" ]; then
     export CC=${C_COMPILER}
     export CXX=${CXX_COMPILER}
 
-    sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/${C_COMPILER} 10
-    sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/${CXX_COMPILER} 10
+    sudo update-alternatives --install /usr/bin/gcc gcc "/usr/bin/${C_COMPILER}" 10
+    sudo update-alternatives --install /usr/bin/g++ g++ "/usr/bin/${CXX_COMPILER}" 10
 
     sudo update-alternatives --set gcc "/usr/bin/${C_COMPILER}"
     sudo update-alternatives --set g++ "/usr/bin/${CXX_COMPILER}"
 fi
 
-if [ "$TRAVIS_OS_NAME" == "linux" ]; then
-    source /opt/qt${QT_PKG}/bin/qt${QT_PKG}-env.sh || true;
+if [ "$TRAVIS_OS_NAME" = "linux" ]; then
+    # shellcheck disable=SC1090
+    . "/opt/qt${QT_PKG}/bin/qt${QT_PKG}-env.sh" || true;
 fi
 
-if [ "$TRAVIS_OS_NAME" == "osx" ]; then
+if [ "$TRAVIS_OS_NAME" = "osx" ]; then
     export CMAKE_PREFIX_PATH=/usr/local/opt/qt5
 fi
 
 # Build & install dependencies
 cmake -GNinja -Hdeps -B.deps \
-    -DUSE_BUNDLED_BOOST=${USE_BUNDLED_BOOST} \
-    -DUSE_BUNDLED_CMARK=${USE_BUNDLED_CMARK} \
-    -DUSE_BUNDLED_JSON=${USE_BUNDLED_JSON}
+    -DUSE_BUNDLED_BOOST="${USE_BUNDLED_BOOST}" \
+    -DUSE_BUNDLED_CMARK="${USE_BUNDLED_CMARK}" \
+    -DUSE_BUNDLED_JSON="${USE_BUNDLED_JSON}"
 cmake --build .deps
 
 # Build nheko
@@ -34,14 +35,14 @@ cmake -GNinja -H. -Bbuild \
     -DCMAKE_INSTALL_PREFIX=.deps/usr
 cmake --build build
 
-if [ "$TRAVIS_OS_NAME" == "osx" ]; then
+if [ "$TRAVIS_OS_NAME" = "osx" ]; then
     make lint;
 
-    if [ $DEPLOYMENT == 1 ] && [ ! -z $VERSION ] ; then
+    if [ "$DEPLOYMENT" = 1 ] && [ ! -z "$VERSION" ] ; then
         make macos-deploy;
     fi
 fi
 
-if [ "$TRAVIS_OS_NAME" == "linux" ] && [ $DEPLOYMENT == 1 ] && [ ! -z $VERSION ]; then
+if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$DEPLOYMENT" = 1 ] && [ ! -z "$VERSION" ]; then
     make linux-deploy;
 fi