poppy-client/FixMime

43 lines
1013 B
Bash
Executable File

#!sh
# This mechanism is fairly unreliable, but it is the only "okay" way currently :/
# realpath is also not part of any POSIX standard
# This script exists because mimetypes on Haiku are not derived from pathnames (.lua)
# but git does not store the mimetype (extended attribute) either
cd $(dirname $(realpath "$0"))
if test $? -eq 1; then
alert --stop "cant figure out where this script is" "Ill adjust it!"
exit
fi
touch log
for i in lua/*.lua; do
echo "$i" >> log
addattr -t mime BEOS:TYPE text/x-source-code $i;
done
for i in server/*.lua; do
echo "$i" >> log
addattr -t mime BEOS:TYPE text/x-source-code $i;
done
for i in server/commands/*.lua; do
echo "$i" >> log
addattr -t mime BEOS:TYPE text/x-source-code $i;
done
for i in server/unpriviliged_commands/*.lua; do
echo "$i" >> log
addattr -t mime BEOS:TYPE text/x-source-code $i;
done
for i in shared/*.lua; do
echo "$i" >> log
addattr -t mime BEOS:TYPE text/x-source-code $i;
done
alert --info "Fixed mime types
$(cat log)"
rm log