about summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorPjotr Prins2016-09-13 09:09:21 +0200
committerPjotr Prins2016-09-13 09:09:21 +0200
commitf399b3bf514b396de67644d4b1e2018886cecac2 (patch)
treeac7bae3642875a730c4cee662cd94ebaaebf3e7c /bin
parentd3ee8ad4b193cdcb9762a267955a2778ea75dc5a (diff)
downloadgenenetwork2-f399b3bf514b396de67644d4b1e2018886cecac2.tar.gz
Run scripts from ./wqflask - just like the webserver
Diffstat (limited to 'bin')
-rwxr-xr-xbin/genenetwork29
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2
index 3a8c3ff4..d926d6a1 100755
--- a/bin/genenetwork2
+++ b/bin/genenetwork2
@@ -13,13 +13,12 @@
 # Environment settings can be used to preconfigure as well as a
 # settings.py file.
 
-# Absolute path to this script, e.g. /home/user/bin/foo.sh
 SCRIPT=$(readlink -f "$0")
-# Absolute path this script is in, thus /home/user/bin
 GN2_BASE_PATH=$(dirname $(dirname "$SCRIPT"))
 
 GN2_GUIX_PATH=$GN2_BASE_PATH/lib/python2.7/site-packages/genenetwork2-2.0-py2.7.egg
 if [ -d $GN2_GUIX_PATH ]; then
+  echo GN2 is running from GUIX
   GN2_BASE_PATH=$GN2_GUIX_PATH
 fi
 echo $GN2_BASE_PATH
@@ -48,9 +47,11 @@ fi
 
 # Now handle command parameter -c
 if [ $1 = '-c' ] ; then
+    cd $GN2_BASE_PATH/wqflask
+    cmd=${2#wqflask/}
     echo PYTHONPATH=$PYTHONPATH
-    echo RUNNING COMMAND $2
-    /usr/bin/env python $2
+    echo RUNNING COMMAND $cmd
+    /usr/bin/env python $cmd
     exit 0
 fi