medit/moo/mooedit/language-specs/check.sh

41 lines
644 B
Bash
Raw Normal View History

2006-08-26 02:46:29 -07:00
#!/bin/sh
2007-06-29 03:43:00 -07:00
# "./check.sh files..." will validate files given on command line.
# "./check.sh" without arguments will validate all lang and styles files
# in the source directory
2006-08-26 02:46:29 -07:00
2007-07-04 20:24:09 -07:00
check_file() {
case $1 in
2007-06-29 03:43:00 -07:00
*.xml)
xmllint --relaxng styles.rng --noout $file || exit 1
;;
*)
xmllint --relaxng language2.rng --noout $file || exit 1
;;
esac
2007-07-04 20:24:09 -07:00
}
if [ $1 ]; then
for file in $@; do
check_file $file
done
exit 0
fi
if [ "$srcdir" ]; then
cd $srcdir
fi
langs=""
for l in *.lang; do
case $l in
2007-07-16 13:42:56 -07:00
msil.lang) ;;
*)
langs="$langs $l"
;;
esac
done
for file in $langs *.xml; do
2007-07-04 20:24:09 -07:00
check_file $file
2006-08-26 02:46:29 -07:00
done