moved to bash instead of sh
rewrite testing for existing file and directory so that hopefully it works on both Linux and MacOs
-#!/bin/sh
+#!/bin/bash
if [[ "$OSTYPE" == "darwin"* ]]; then
OS='macosx-universal-64'
OS='linux-x86-64'
fi
-if ! ls sonar-application/target/sonarqube-*.zip &> /dev/null; then
+ls sonar-application/target/sonarqube-*.zip 1> /dev/null 2>&1
+if [ "$?" != "0" ]; then
echo 'Sources are not built'
./build.sh
fi
cd sonar-application/target/
-if ! ls sonarqube-*/bin/$OS/sonar.sh &> /dev/null; then
+ls sonarqube-*/bin/$OS/sonar.sh 1> /dev/null 2>&1
+if [ "$?" != "0" ]; then
unzip sonarqube-*.zip
fi
cd sonarqube-*
-#!/bin/sh
+#!/bin/bash
# Shortcut to stop server. It must be already built.