improve script loop

This commit is contained in:
Denys Vuika
2023-11-21 14:46:11 +00:00
parent 7e1c1f472e
commit 32f32d5307

View File

@@ -191,15 +191,15 @@ while [[ $1 == -* ]]; do
done done
if $GNU; then if $GNU; then
sedi='-i' sedi='-i'
else else
sedi=('-i' '') sedi=('-i' '')
fi fi
if [[ "${VERSION}" == "" ]] if [[ "${VERSION}" == "" ]]
then then
echo "Version number required" echo "Version number required"
exit 1 exit 1
fi fi
cd "$DIR/../" cd "$DIR/../"
@@ -207,18 +207,18 @@ cd "$DIR/../"
echo "====== UPDATE COMPONENTS ======" echo "====== UPDATE COMPONENTS ======"
# use for loop to read all values and indexes # use for loop to read all values and indexes
for (( i=0; i<${projectslength}; i++ )); for PROJECT in ${projects[@]}
do do
echo "====== UPDATE COMPONENT ${projects[$i]} ======" echo "====== UPDATE COMPONENT $PROJECT ======"
update_component_version ${projects[$i]} update_component_version $PROJECT
update_component_dependency_version ${projects[$i]} update_component_dependency_version $PROJECT
if $JS_API == true; then if $JS_API == true; then
if $DIFFERENT_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 else
update_component_js_version ${projects[$i]} ${VERSION} update_component_js_version $PROJECT $VERSION
fi fi
fi fi