element-maker: allow to run from a different working directory

Get the dirname for the script and use that to reference the templates. Use the
templatedir variable to check for templates.
This commit is contained in:
Stefan Kost 2011-04-19 15:09:54 -04:00
parent 9f38ae9227
commit a161f901eb

View file

@ -2,7 +2,8 @@
prefix=gst
templatedir=element-templates
basedir=`dirname $0`
templatedir=$basedir/element-templates
while [ "$1" ] ; do
case $1 in
@ -44,7 +45,7 @@ if [ "$name" = "" -o "$class" = "" ] ; then
exit 1
fi
if [ ! -f "element-templates/$class" ] ; then
if [ ! -f "$templatedir/$class" ] ; then
echo "Template file for $class not found."
exit 1
fi