summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rwxr-xr-xutil/bin/make-data-uri7
-rwxr-xr-xutil/bin/make-data-url7
2 files changed, 14 insertions, 0 deletions
diff --git a/util/bin/make-data-uri b/util/bin/make-data-uri
new file mode 100755
index 00000000..a9d014e6
--- /dev/null
+++ b/util/bin/make-data-uri
@@ -0,0 +1,7 @@
+#! /bin/sh
+set -euf
+for path; do
+ type="`file -bi "$path"`"
+ data="`base64 -w 0 "$path"`"
+ echo "data:$type;base64,$data"
+done
diff --git a/util/bin/make-data-url b/util/bin/make-data-url
new file mode 100755
index 00000000..a9d014e6
--- /dev/null
+++ b/util/bin/make-data-url
@@ -0,0 +1,7 @@
+#! /bin/sh
+set -euf
+for path; do
+ type="`file -bi "$path"`"
+ data="`base64 -w 0 "$path"`"
+ echo "data:$type;base64,$data"
+done