Skip to content

Commit 222fa8b

Browse files
authored
Scripts: Fail on error (Dobiasd#327)
* Scripts: Fail on error * Fix doctest CMake compatibility * Fix Windows path issue
1 parent 5f5364b commit 222fa8b

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

script/auto_format.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/usr/bin/env bash
2+
3+
set -e
4+
25
(find api_search -name "*.cpp" && find include -name "*.hpp" && find examples -name "*.cpp" && find test -name "*.cpp") | xargs clang-format -i {}

script/ci.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
set -e
4+
35
# Central script called by the CI
46
# Usage:
57
# ci.sh {run_build|run_tests}
@@ -17,7 +19,7 @@ if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
1719
# Windows path handling is a never ending source of ...
1820
INSTALL_PREFIX="$USERPROFILE\\.local"
1921
INSTALL_PREFIX=$(cygpath -u "$INSTALL_PREFIX") # Make CMake happy when using git bash under windows
20-
export CMAKE_PREFIX_PATH=$INSTALL_PREFIX;$CMAKE_PREFIX_PATH # Notice the ";" instead of ":"
22+
export CMAKE_PREFIX_PATH="${INSTALL_PREFIX}${CMAKE_PREFIX_PATH:+;${CMAKE_PREFIX_PATH}}" # Notice the ";" instead of ":"
2123
else
2224
INSTALL_PREFIX="$HOME/.local"
2325
export CMAKE_PREFIX_PATH=$INSTALL_PREFIX:$CMAKE_PREFIX_PATH
@@ -26,7 +28,7 @@ fi
2628
# Function to install doctest
2729
_install_doctest() {
2830
cd "$REPO_DIR"
29-
git clone --depth=1 --branch=v2.4.11 https://github.com/doctest/doctest
31+
git clone --depth=1 --branch=v2.4.12 https://github.com/doctest/doctest
3032
cd doctest && mkdir -p build && cd build
3133
cmake .. -DDOCTEST_WITH_TESTS=OFF -DDOCTEST_WITH_MAIN_IN_STATIC_LIB=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
3234
cmake --build . --config Release --target install

script/ci_setup_linux.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
22

3+
set -e
4+
35
apt-get update
46
apt-get install -y git

0 commit comments

Comments
 (0)