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/.
25 lines
637 B
Bash
Executable File
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
|