Check if we’re running in a Terminal – only pretty print the response
- ID
b4300c2- date
2024-10-24 09:06:31+00:00- author
Alex Chan <alex@alexwlchan.net>- parent
4e137c6- message
# Check if we're running in a Terminal -- only pretty print the response # with colours if so.- changed files
1 file, 2 additions
Changed files
text/pp_xml.sh (158) → text/pp_xml.sh (253)
diff --git a/text/pp_xml.sh b/text/pp_xml.sh
index 8566e71..b2deda8 100755
--- a/text/pp_xml.sh
+++ b/text/pp_xml.sh
@@ -3,6 +3,8 @@
set -o errexit
set -o nounset
+# Check if we're running in a Terminal -- only pretty print the response
+# with colours if so.
if [ -t 1 ]
then
echo "terminal"