2013-06-18 00:18:38 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-09-18 00:11:35 +02:00
|
|
|
# Commits updates to apps, allowing you to edit the commit messages
|
|
|
|
|
2013-09-06 23:36:10 +02:00
|
|
|
commands=()
|
|
|
|
|
2013-06-18 00:18:38 +02:00
|
|
|
while read line; do
|
|
|
|
if [[ "$line" == *M*metadata/*.txt ]]; then
|
|
|
|
file=${line##* }
|
|
|
|
|
|
|
|
newbuild=0
|
|
|
|
while read l; do
|
|
|
|
if [[ "$l" == "+Build Version:"* ]]; then
|
|
|
|
newbuild=1
|
|
|
|
build=${l#*:}
|
|
|
|
version=${build%%,*}
|
|
|
|
build=${build#*,}
|
|
|
|
vercode=${build%%,*}
|
|
|
|
fi
|
2013-06-27 21:32:06 +02:00
|
|
|
done < <(git diff HEAD -- "$file")
|
2013-06-18 00:18:38 +02:00
|
|
|
|
|
|
|
[ $newbuild -eq 0 ] && continue
|
|
|
|
|
|
|
|
while read l; do
|
|
|
|
[[ "$l" == "Auto Name:"* ]] && name=${l##*:}
|
|
|
|
done < "$file"
|
|
|
|
|
|
|
|
id=${file##*/}
|
|
|
|
id=${id%.txt*}
|
2013-07-04 13:54:53 +02:00
|
|
|
[ -d metadata/$id ] && extra=metadata/$id
|
2013-06-18 00:18:38 +02:00
|
|
|
[ -n "$name" ] && id="$name ($id)"
|
2013-09-06 23:36:10 +02:00
|
|
|
|
|
|
|
commands+=("git commit -m 'Update $id to $version ($vercode)' -e -- $file $extra")
|
2013-06-18 00:18:38 +02:00
|
|
|
fi
|
|
|
|
done < <(git status --porcelain)
|
2013-07-02 14:39:56 +02:00
|
|
|
|
2013-09-06 23:36:10 +02:00
|
|
|
for cmd in "${commands[@]}"; do
|
|
|
|
eval "$cmd"
|
|
|
|
done
|
2013-09-06 23:28:11 +02:00
|
|
|
|