tools/render-images (view raw, download)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#!/bin/bash
if [[ $# -ne 3 ]]
then
echo "Usage: ./render-images <GIT_DIR> <MAP_FILENAME> <OUTPUT_DIR>"
echo -e "\texample: ./render-images . FOO.WAD out"
exit 1
fi
GIT_DIR="$1"
MAP_FILENAME="$2"
OUTPUT_DIR="$3"
mkdir -p "$OUTPUT_DIR"
for commit in $(git -C "$GIT_DIR" log --oneline --reverse --format=format:%at_%h)
do
echo "$commit"
timestamp=$(echo $commit | cut -d_ -f1)
sha=$(echo $commit | cut -d_ -f2)
git show \
${sha}:${MAP_FILENAME} \
> ${OUTPUT_DIR}/${timestamp}_${sha}.${MAP_FILENAME}
done
|