summaryrefslogtreecommitdiff
path: root/xml-format
diff options
context:
space:
mode:
authorAnton Bobov <abobov@gmail.com>2020-05-10 22:10:27 +0500
committerAnton Bobov <abobov@gmail.com>2020-05-10 22:10:27 +0500
commit279750251f0d6e864d3d80855b7fd3164387e3c6 (patch)
tree9f0525e25bd11c1906089effd524fd0f0e66516e /xml-format
parent93d134d42b388581da215ed47ad87687dc8e41f1 (diff)
Updates.
Diffstat (limited to 'xml-format')
-rwxr-xr-xxml-format12
1 files changed, 12 insertions, 0 deletions
diff --git a/xml-format b/xml-format
new file mode 100755
index 0000000..76a29bb
--- /dev/null
+++ b/xml-format
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if [ -x "$(command -v xmlstarlet)" ] ; then
+ xmlstarlet format --omit-decl
+elif [ -x "$(command -v xmllint)" ] ; then
+ xmllint --format -
+else
+ exit 1
+fi
+