Files
image_processing/tests/mocks/magick
T
poprhythm f5ed6617c5 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/.
2026-07-03 19:49:04 -04:00

25 lines
637 B
Bash
Executable File

#!/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