poppy-client/FixMime

43 lines
1013 B
Plaintext
Raw Permalink Normal View History

#!sh
2022-10-13 10:22:46 +00:00
# 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
2022-10-13 10:22:46 +00:00
cd $(dirname $(realpath "$0"))
if test $? -eq 1; then
alert --stop "cant figure out where this script is" "Ill adjust it!"
exit
fi
2022-10-13 10:22:46 +00:00
touch log
for i in lua/*.lua; do
2022-10-13 10:22:46 +00:00
echo "$i" >> log
addattr -t mime BEOS:TYPE text/x-source-code $i;
done
for i in server/*.lua; do
2022-10-13 10:22:46 +00:00
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
2022-10-13 10:22:46 +00:00
alert --info "Fixed mime types
$(cat log)"
rm log