Skip to content

Commit 5b32b2d

Browse files
committed
Ensure dependencies file exists and fail otherwise
1 parent f7bf2b4 commit 5b32b2d

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/install-dependencies.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
# This script installs gvm-libs dependencies
33
set -e
44

5-
BASEDIR=$(dirname $0)
5+
BASEDIR=$(dirname "$0")
66
DEFAULT_DEPENDENCIES_FILE="$BASEDIR/build-dependencies.list"
77
DEPENDENCIES_FILE=${1:-$DEFAULT_DEPENDENCIES_FILE}
88

9+
if [[ ! -f "$DEPENDENCIES_FILE" ]]; then
10+
echo "Dependencies file not found: $DEPENDENCIES_FILE"
11+
exit 1
12+
fi
13+
914
apt-get update && \
1015
apt-get install -y --no-install-recommends --no-install-suggests \
11-
$(cat $DEPENDENCIES_FILE | grep -v '#') \
16+
$(grep -v '#' "$DEPENDENCIES_FILE")

0 commit comments

Comments
 (0)