all repos — shwarp-tools @ 2ec44fb23e274984c76ae00a508df45b0ecf5b56

Tools and scripts

tool(render-timelapse): combine file and dir params

While here, check dir is git dir.
shwarp
Sun, 30 Aug 2026 15:52:55 -0400
commit

2ec44fb23e274984c76ae00a508df45b0ecf5b56

parent

e2acab76eb7f0dee2d11174d2fd82003bdbbbf82

1 files changed, 11 insertions(+), 6 deletions(-)

jump to
M tools/render-timelapse → tools/render-timelapse

@@ -1,10 +1,10 @@

#!/bin/bash -if [[ $# -ne 3 ]] +if [[ $# -ne 2 ]] then - echo "Usage: ./render-timelapse <GIT_DIR> <MAP_FILENAME> <OUTPUT_DIR>" - echo -e "\texample: ./render-images . FOO.WAD out" + echo "Usage: ./render-timelapse <FILE_PATH> <OUTPUT_DIR>" + echo -e "\texample: ./render-images ./file_path/FOO.WAD out" exit 1 fi

@@ -15,9 +15,14 @@ echo "This script requires the program 'wad2svg'"

exit 1 fi -GIT_DIR="$1" -MAP_FILENAME="$2" -OUTPUT_DIR="$3" +MAP_FILENAME=$(basename "$1") +GIT_DIR=$(echo ${1::-"$((${#MAP_FILENAME} + 1))"}) +OUTPUT_DIR="$2" + +if [ ! -d "$GIT_DIR/.git" ] || ! git -C "$GIT_DIR" rev-parse 2>/dev/null +then + echo "'${GIT_DIR}' must be an initialised GIT directory" +fi WAD_DIR=~/doom/DOOM2.WAD