Add bats test suite for image processing scripts
Tests cover skip-already-processed logic, cleanup, idempotency, and the config.sh single-source-of-truth invariant. bats-core, bats-assert, and bats-support added as submodules under tests/libs/.
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
# Mock for ~/Applications/magick.
|
||||
# identify: delegate to real system identify.
|
||||
# convert (resize call): copy in-place and embed the comment so the file
|
||||
# looks processed on the next run.
|
||||
if [ "$1" = "identify" ]; then
|
||||
shift
|
||||
identify "$@"
|
||||
exit $?
|
||||
fi
|
||||
|
||||
# Parse -set comment <value> and the output file (last arg) from the argument list
|
||||
COMMENT=""
|
||||
OUTFILE="${@: -1}"
|
||||
args=("$@")
|
||||
for i in "${!args[@]}"; do
|
||||
if [ "${args[$i]}" = "-set" ] && [ "${args[$i+1]}" = "comment" ]; then
|
||||
COMMENT="${args[$i+2]}"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$COMMENT" ]; then
|
||||
convert "$OUTFILE" -set comment "$COMMENT" "$OUTFILE"
|
||||
fi
|
||||
Reference in New Issue
Block a user