Skip to content

Commit

Permalink
feat: ✨ add for loop through cmd
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Augustin <dev@andreas-augustin.org>
  • Loading branch information
AndreasAugustin committed Apr 22, 2024
1 parent d0d70e1 commit 397ee30
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -480,18 +480,18 @@ function arr_push_prepare_pr_create_pr() {
echo "::endgroup::"
}

declare -A arr

arr["prechecks"]=arr_prechecks
arr["pull"]=arr_checkout_branch_and_pull
arr["commit"]=arr_commit
arr["push"]=arr_push
arr["pr"]=arr_push_prepare_pr_create_pr

${arr["prechecks"]}
${arr["pull"]}
${arr["commit"]}
${arr["push"]}
${arr["pr"]}
declare -A cmd_arr

cmd_arr["prechecks"]=arr_prechecks
cmd_arr["pull"]=arr_checkout_branch_and_pull
cmd_arr["commit"]=arr_commit
cmd_arr["push"]=arr_push
cmd_arr["pr"]=arr_push_prepare_pr_create_pr

# loop through array keys
for key in "${!cmd_arr[@]}";
do
${cmd_arr[key]}
done

set_github_action_outputs "${PR_BRANCH}" "${TEMPLATE_GIT_HASH}"

0 comments on commit 397ee30

Please sign in to comment.