aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/os.sh
blob: 0564e3c2adb9ecca18ba83b80fc1a3a5e0528712 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
###############################
# Helper for OS folders and scripts
###############################

set -euo pipefail

if [[ "${OSTYPE:-}" == "darwin"* ]]; then
  OS_DIR='macosx-universal-64'
  SH_FILE="sonar.sh"
elif [[ "${OSTYPE:-}" == "msys"* ]]; then
  OS_DIR='windows-x86-64'
  SH_FILE="StartSonar.bat"
else
  OS_DIR='linux-x86-64'
  SH_FILE="sonar.sh"
fi

runSQ() {
  if [[ "${OSTYPE:-}" == "msys"* ]]; then
    "$1"
  else
    "$1" start
  fi
}