mirror of
https://github.com/tonydamage/nux-env.git
synced 2025-12-11 13:24:28 +01:00
22 lines
474 B
Bash
22 lines
474 B
Bash
nux.mime() {
|
|
local type=binary/octet
|
|
local suffix="${1##*.}"
|
|
case "${suffix,,}" in
|
|
txt) type=text/plain;;
|
|
css) type=text/css;;
|
|
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;;
|
|
*)
|
|
if [ -d "$1" ]; then
|
|
type=directory
|
|
fi
|
|
esac
|
|
echo $type;
|
|
|
|
}
|