chiark / gitweb /
changelog: document further make-release changes
[otter.git] / run-inkscape-extension
index 4e1c94a6c48ac2409494f10f9870eba5c86afce5..8a860c0c3fa85f96d6e6952e3f9ee01f46682825 100755 (executable)
 # I don't think it is going to be possible to sanely find out what
 # python version is actually expected.  But I think a *reasonable*
 # demand on the environment is that either:
-#   - These if these scripts are executable, they can be executed
+#   - 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