From: Daniel Martí Date: Fri, 6 Sep 2013 21:36:10 +0000 (+0200) Subject: Save all commit updates in an array, loop over them later X-Git-Tag: 0.1~403^2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=c52203f87d9b045cf8ab5685a2b8324a428f7f3e;p=fdroidserver.git Save all commit updates in an array, loop over them later --- diff --git a/commitupdates b/commitupdates index 69c24b38..bde57e23 100755 --- a/commitupdates +++ b/commitupdates @@ -1,5 +1,7 @@ #!/bin/bash +commands=() + while read line; do if [[ "$line" == *M*metadata/*.txt ]]; then file=${line##* } @@ -25,9 +27,12 @@ while read line; do id=${id%.txt*} [ -d metadata/$id ] && extra=metadata/$id [ -n "$name" ] && id="$name ($id)" + + commands+=("git commit -m 'Update $id to $version ($vercode)' -e -- $file $extra") fi done < <(git status --porcelain) -echo "> git commit -m \"Update $id to $version ($vercode)\" -e -- $file $extra" -git commit -m "Update $id to $version ($vercode)" -e -- $file $extra +for cmd in "${commands[@]}"; do + eval "$cmd" +done