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 12b9308
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//\//_}
_remove_commit=${var^^}_COMMIT
commit_expected=${!_remove_commit}

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

0 comments on commit 12b9308

Please sign in to comment.