mygui/MyGUI-Demos
Bruno Wolff III 045809f220 Don't use removed find option
MyGUI-Demos and MyGUI-Tools used + instead of / with the -perm
predicate. This no longer works and needed to be updated.
2014-12-30 23:17:16 -06:00

49 lines
1 KiB
Bash

#!/bin/sh
# Based on Ogre-Samples by Alexey Torkhov shipped with ogre-samples package.
runSample()
{
sample=$1
echo "Running $sample..."
$LIBDIR/MYGUI/Demos/$sample
}
set -e
# find out LIBDIR
if [ -f /usr/lib64/MYGUI/Demos/resources.xml ]; then
LIBDIR=/usr/lib64
else
LIBDIR=/usr/lib
fi
mkdir -p $HOME/.mygui-demos
cd $HOME/.mygui-demos
for i in plugins.cfg resources.xml; do
cp -f $LIBDIR/MYGUI/Demos/$i .
done
set +e
if [ "$1" = "-a" ]; then
for i in `(cd $LIBDIR/MYGUI/Demos/; find -type f -perm /111 | sort)`; do
runSample `echo $i | sed 's|./||'`
done
elif [ $# -ge 1 ]; then
while [ $# -ge 1 ]; do
runSample $1
shift
done
else
echo "Usage:" `basename $0` "[-a] [sample [...]]"
echo " -a : Run all samples installed to $LIBDIR/MYGUI/Demos/"
echo " sample : Run the sample(s) named 'sample' (see list bellow)"
echo
echo -n "Available samples:"
echo
for i in `(cd $LIBDIR/MYGUI/Demos/; find -type f -perm /111 | sort)`; do
echo " * $i" | sed 's|./||'
done
echo
fi