element-maker: allow to run from a different working directory
authorStefan Kost <ensonic@users.sf.net>
Tue, 19 Apr 2011 19:09:54 +0000 (15:09 -0400)
committerStefan Kost <ensonic@users.sf.net>
Tue, 26 Apr 2011 07:42:55 +0000 (03:42 -0400)
Get the dirname for the script and use that to reference the templates. Use the
templatedir variable to check for templates.

tools/gst-element-maker

index 777df12..6db321d 100755 (executable)
@@ -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