1
1
Fork 0
mirror of https://github.com/tonydamage/nux-env.git synced 2025-12-11 13:24:28 +01:00

Nuweb drop

Signed-off-by: root <root@tdm-cloud.(none)>
This commit is contained in:
root 2019-03-09 12:32:11 +01:00
parent ee9a720f67
commit a7b55553ad
62 changed files with 1772 additions and 608 deletions

37
inc/nux/mime.nuxsh.sh Executable file
View file

@ -0,0 +1,37 @@
function nux.mime {
nux.mime.naive.suffix "$@"
}
@namespace nux.mime {
function :naive.suffix filename {
local type=binary/octet
local suffix="${filename##*.}"
suffix="${suffix,,}"
if [ -d "$filename" ]; then
type=directory
else
case "${suffix,,}" in
txt) type=text/plain;;
css) type=text/css;;
jpeg) ;&
jpg) type=image/jpeg;;
png) type=image/png;;
zip) type=application/zip;;
cbr) type=application/x-cbz;;
cbz) type=application/x-cbr;;
pdf) type=application/pdf;;
epub) type=application/epub+zip;;
mp4) type=video/mp4;;
esac
fi
echo $type;
}
}