Browse Source

starpupy/examples/execute.sh.in: also look for python script in current directory

Nathalie Furmento 5 years ago
parent
commit
18cd24d042
1 changed files with 9 additions and 5 deletions
  1. 9 5
      starpupy/examples/execute.sh.in

+ 9 - 5
starpupy/examples/execute.sh.in

@@ -15,20 +15,24 @@
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 #
 
-set -x
-
 exampledir=@STARPU_SRC_DIR@/starpupy/examples
 
 modpath=@STARPU_BUILD_DIR@/src/.libs:
 pypath=@STARPU_BUILD_DIR@/starpupy/src/build:$PYTHONPATH
 
 examplefile=$1
-if test ! -f $exampledir/$examplefile
+if test -f $examplefile
 then
-    echo "Error. File $exampledir/$examplefile not found"
+    pythonscript=$examplefile
+elif test -f $exampledir/$examplefile
+then
+    pythonscript=$exampledir/$examplefile
+else
+    echo "Error. Python script $examplefile not found in current directory or in $exampledir"
     exit 1
 fi
 shift
 
-PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath @PYTHON@ $exampledir/$examplefile $*
+set -x
+PYTHONPATH=$pypath LD_LIBRARY_PATH=$modpath @PYTHON@ $pythonscript $*