#!/bin/bash
+commands=()
+
while read line; do
if [[ "$line" == *M*metadata/*.txt ]]; then
file=${line##* }
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