Skip to content

Commit

Permalink
scripts: module-check: replace eval with indirection
Browse files Browse the repository at this point in the history
  • Loading branch information
grische committed Jul 1, 2024
1 parent cf0d2ce commit b6f7e4b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/module_check.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash
# shellcheck disable=SC2154

set -e

Expand All @@ -15,8 +14,10 @@ fi
need_sync=false

for module in $GLUON_MODULES; do
var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
eval 'commit_expected=${'"${var}"'_COMMIT}'
echo "Checking module '$module'"
var=${module//\//_}
_remote_commit=${var^^}_COMMIT
commit_expected=${!_remote_commit}

prefix=invalid
cd "$GLUONDIR/$module" 2>/dev/null && prefix="$(git rev-parse --show-prefix 2>/dev/null)"
Expand Down

0 comments on commit b6f7e4b

Please sign in to comment.