From cf0d2cedce41441bb23ba6f4881fcc1a3d433e61 Mon Sep 17 00:00:00 2001 From: Grische <github@grische.xyz> Date: Mon, 1 Jul 2024 22:26:32 +0200 Subject: [PATCH] scripts: update: replace evals with indirection --- scripts/update.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/update.sh b/scripts/update.sh index b6c0565e7..365e86c2e 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -1,5 +1,4 @@ #!/bin/bash -# shellcheck disable=SC2154 set -e @@ -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" -- GitLab