#!/bin/bash if [[ $# -ne 3 ]] then echo "Usage: ./render-images " 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