Improve samples organization, add check script
This commit is contained in:
parent
636e51510d
commit
39a6cbe67d
7 changed files with 28 additions and 0 deletions
27
samples/check.sh
Executable file
27
samples/check.sh
Executable file
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
for file in */*
|
||||||
|
do
|
||||||
|
filetype="$(xdg-mime query filetype "${file}")"
|
||||||
|
if [ -z "${filetype}" ]
|
||||||
|
then
|
||||||
|
echo "${file}: no filetype found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "${file%.*}" != "${filetype}" ]
|
||||||
|
then
|
||||||
|
echo "${file} is not named according to filetype ${filetype}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
default="$(xdg-mime query default "${filetype}")"
|
||||||
|
if [ -z "${default}" ]
|
||||||
|
then
|
||||||
|
echo "${file}: ${filetype}: no default application found"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "${file}: ${filetype}: ${default}"
|
||||||
|
done
|
||||||
1
samples/text/plain.txt
Normal file
1
samples/text/plain.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
This is a plain text file.
|
||||||
Loading…
Add table
Add a link
Reference in a new issue