summaryrefslogtreecommitdiff
path: root/nocompile/bin
diff options
context:
space:
mode:
Diffstat (limited to 'nocompile/bin')
-rwxr-xr-xnocompile/bin/decode_html_entities1
-rwxr-xr-xnocompile/bin/encode_html_entities3
-rwxr-xr-xnocompile/bin/fontbuild.sh2
-rwxr-xr-xnocompile/bin/mime-type12
4 files changed, 12 insertions, 6 deletions
diff --git a/nocompile/bin/decode_html_entities b/nocompile/bin/decode_html_entities
index 08bd7c9..dea945a 100755
--- a/nocompile/bin/decode_html_entities
+++ b/nocompile/bin/decode_html_entities
@@ -1,4 +1,5 @@
#!/bin/sh
sed "s/\>/>/g" \
| sed "s/\&lt;/</g" \
+ | sed 's/\&quot;/"/g' \
| sed "s/\&amp;/\&/g"
diff --git a/nocompile/bin/encode_html_entities b/nocompile/bin/encode_html_entities
index 4cb1836..e2bcf30 100755
--- a/nocompile/bin/encode_html_entities
+++ b/nocompile/bin/encode_html_entities
@@ -1,4 +1,5 @@
#!/bin/sh
sed "s/&/\&amp;/g" \
| sed "s/</\&lt;/g" \
- | sed "s/>/\&gt;/g"
+ | sed "s/>/\&gt;/g" \
+ | sed 's/"/\&quot;/g'
diff --git a/nocompile/bin/fontbuild.sh b/nocompile/bin/fontbuild.sh
new file mode 100755
index 0000000..cd16ec8
--- /dev/null
+++ b/nocompile/bin/fontbuild.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+grep -v ^0 | tr -d '\n' | fontbuild
diff --git a/nocompile/bin/mime-type b/nocompile/bin/mime-type
index 2b1bad0..83dc116 100755
--- a/nocompile/bin/mime-type
+++ b/nocompile/bin/mime-type
@@ -1,13 +1,15 @@
#!/bin/sh
-TYPE="$(file -b --mime-type $1)"
-MAIN="$(echo "${TYPE}" | cut -d/ -f1)"
-SUB="$(echo "${TYPE}" | cut -d/ -f2)"
+EXT="$(printf "%s" "$1" | rev | cut -d. -f1 | rev)"
+TYPE="$(file -b --mime-type "$1")"
+MAIN="$(printf "%s" "${TYPE}" | cut -d/ -f1)"
+SUB="$(printf "%s" "${TYPE}" | cut -d/ -f2)"
if [ "_${MAIN}" = "_inode" ];then
- printf "text/plain\r\n"
-# printf "this is a directory or symlink! wtf?!?" #ssssshhhhh
TYPE="text/plain"
fi
if [ "_${MAIN}" = "_text" -a "_${SUB}" != "_html" ];then
TYPE="text/plain"
fi
+if [ "_${EXT}" = "_css" ];then
+ TYPE="text/css"
+fi
printf "%s\r\n" "$TYPE"