Skip to content

Commit 3c6a7c5

Browse files
committed
fix(ci): validate SOURCE_DIR is a directory in bootstrap-cmake.sh
1 parent 92c764d commit 3c6a7c5

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

.buildkite/bootstrap-cmake.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,20 @@
55
# Configures the CMake build environment based on provided arguments and environment variables.
66

77
set -o errexit
8-
set -o nounset
98
set -o pipefail
109

10+
: "${SOURCE_DIR:?Environment variable SOURCE_DIR must be set (path to source code)}"
11+
if [[ ! -d "${SOURCE_DIR}" ]]; then
12+
echo "Error: SOURCE_DIR '${SOURCE_DIR}' is not a directory." >&2
13+
exit 1
14+
fi
15+
16+
set -o nounset
17+
1118
if [[ -n "${DEBUG:-}" ]]; then
1219
set -o xtrace
1320
fi
1421

15-
: "${SOURCE_DIR:?Environment variable SOURCE_DIR must be set (path to source code)}"
16-
1722
echo "--- 🔧 Configuring CMake build"
1823
# shellcheck disable=1091
1924
source /etc/profile.d/enable-gcc-toolset.sh

0 commit comments

Comments
 (0)