From: Ian Jackson Date: Sun, 15 May 2022 14:58:12 +0000 (+0100) Subject: run-inkscape-extension: Work around a weird inkscape behaviour X-Git-Tag: otter-1.1.0~106 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=34240f059553a15e2aa93c79506f34dd6ca0d6be;p=otter.git run-inkscape-extension: Work around a weird inkscape behaviour Without this, generic recolour instructions in shape libraries don't work right if some of the recolourings don't apply to some of the image files in the group. Which is about to be the case. Signed-off-by: Ian Jackson --- diff --git a/run-inkscape-extension b/run-inkscape-extension index b5a60fb5..8a860c0c 100755 --- a/run-inkscape-extension +++ b/run-inkscape-extension @@ -17,8 +17,22 @@ # - If these scripts are executable, they can be executed # - Otherwise, they are not using ancient and obsolete python +set -e + $( if test -x "$1"; then :; else type -p python3 || type -p python fi ) "$@" + +# Additionally, sometimes inkscape doesn't write the output file. It +# likes to do this if "nothing changed", presumably because of some +# "don't save non-dirty files" logic. That is really nto very +# convenient here! + +if test -f /dev/stdout; then + if test -s /dev/stdout; then :; else + x=("$@"); + cat ${x[-1]} + fi +fi