mygui/MyGUI-Demos
Tomas Hrcka 1ed2c0b106 Revert "Orphaned for 6+ weeks"
This reverts commit 5b4d1825d7.

Unretirement request: https://pagure.io/releng/issue/10047

Signed-off-by: Tomas Hrcka <thrcka@redhat.com>
2021-03-02 11:18:01 +01: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