Skip to content

Commit

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

set -e

Expand All @@ -10,10 +9,14 @@ GLUONDIR="$(pwd)"

for module in $GLUON_MODULES; do
echo "--- Updating module '$module' ---"
var=$(echo "$module" | tr '[:lower:]/' '[:upper:]_')
eval 'repo=${'"${var}"'_REPO}'
eval 'branch=${'"${var}"'_BRANCH}'
eval 'commit=${'"${var}"'_COMMIT}'
var=${module//\//_}
_remote_url=${var^^}_REPO
_remote_branch=${var^^}_BRANCH
_remote_commit=${var^^}_COMMIT

repo=${!_remote_url}
branch=${!_remote_branch}
commit=${!_remote_commit}

mkdir -p "$GLUONDIR/$module"
cd "$GLUONDIR/$module"
Expand Down

0 comments on commit cf0d2ce

Please sign in to comment.