From 7a7bbf12c7bdd99f4c4c902304efcb12f4b5cd02 Mon Sep 17 00:00:00 2001 From: Johannes Theiner Date: Wed, 30 Oct 2019 11:44:46 +0100 Subject: [PATCH] fix syntax for mac --- install.sh | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/install.sh b/install.sh index 7906fb7..7a0f058 100755 --- a/install.sh +++ b/install.sh @@ -1,32 +1,22 @@ #!/usr/bin/env bash install_packages() { - declare -A osInfo; - osInfo[/usr/bin/pacman]=pacman - osInfo[/usr/bin/apt]=apt - osInfo[/usr/local/Homebrew]=brew + if [[ -f /usr/bin/pacman ]]; then + sudo pacman -S clang make cmake fltk catch2 - for f in ${!osInfo[@]} - do - if [[ -f $f ]];then - if [[ ${osInfo[$f]} == 'pacman' ]]; then - sudo pacman -S clang make cmake fltk catch2 + elif [[ -f /usr/bin/apt ]]; then + sudo apt install clang make cmake clang-tidy libfltk1.3 libfltk1.3-dev - elif [[ ${osInfo[$f]} == 'apt' ]]; then - sudo apt install clang make cmake clang-tidy libfltk1.3 libfltk1.3-dev + git clone https://github.com/catchorg/Catch2.git + cd Catch2 + cmake -Bbuild -H. -DBUILD_TESTING=OFF + sudo cmake --build build/ --target install + cd .. - git clone https://github.com/catchorg/Catch2.git - cd Catch2 - cmake -Bbuild -H. -DBUILD_TESTING=OFF - sudo cmake --build build/ --target install - cd .. - - elif [[ ${osInfo[$f]} == 'brew' ]]; then - sudo brew install llvm clang make cmake clang-format fltk catch2 - - fi + elif [[ -f /usr/local/Homebrew ]]; then + sudo brew install llvm clang make cmake clang-format fltk catch2 + fi - done }