From 32f32d53076a4c86a0efa4b083a7c85f090396ab Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 21 Nov 2023 14:46:11 +0000 Subject: [PATCH] improve script loop --- scripts/update-version.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/update-version.sh b/scripts/update-version.sh index cb3accf42f..b69b9999cd 100755 --- a/scripts/update-version.sh +++ b/scripts/update-version.sh @@ -191,15 +191,15 @@ while [[ $1 == -* ]]; do done if $GNU; then - sedi='-i' + sedi='-i' else - sedi=('-i' '') + sedi=('-i' '') fi if [[ "${VERSION}" == "" ]] then - echo "Version number required" - exit 1 + echo "Version number required" + exit 1 fi cd "$DIR/../" @@ -207,18 +207,18 @@ cd "$DIR/../" echo "====== UPDATE COMPONENTS ======" # use for loop to read all values and indexes -for (( i=0; i<${projectslength}; i++ )); +for PROJECT in ${projects[@]} do - echo "====== UPDATE COMPONENT ${projects[$i]} ======" - update_component_version ${projects[$i]} - update_component_dependency_version ${projects[$i]} + echo "====== UPDATE COMPONENT $PROJECT ======" + update_component_version $PROJECT + update_component_dependency_version $PROJECT if $JS_API == true; then if $DIFFERENT_JS_API == true; then - update_component_js_version ${projects[$i]} ${VERSION_JS_API} + update_component_js_version $PROJECT $VERSION_JS_API else - update_component_js_version ${projects[$i]} ${VERSION} + update_component_js_version $PROJECT $VERSION fi fi