aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2018-02-05 16:19:13 +0300
committerMuriithi Frederick Muriuki2018-02-05 16:19:13 +0300
commit6ec9dcc365b899f7f4aaab739103f4559c2c1620 (patch)
tree55d6ccb1d651e368cf9ba587a9f86a2d2af95894
parent93f6d69691d109ba4090c2eba82a72df13fbb060 (diff)
downloadgenenetwork2-6ec9dcc365b899f7f4aaab739103f4559c2c1620.tar.gz
Check each part of the PYTHONPATH
* PYTHONPATH may be composed of multiple locations in the filesystem, thus the need to test that each location exists and is a directory.
-rwxr-xr-xbin/genenetwork26
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/genenetwork2 b/bin/genenetwork2
index 34fbc72e..145ce395 100755
--- a/bin/genenetwork2
+++ b/bin/genenetwork2
@@ -126,7 +126,11 @@ else
export PYLMM_COMMAND="$GN2_PROFILE/bin/pylmm_redis"
export GEMMA_COMMAND="$GN2_PROFILE/bin/gemma"
export GEMMA_WRAPPER_COMMAND="$GN2_PROFILE/bin/gemma-wrapper"
- if [ ! -d $PYTHONPATH ] ; then echo "PYTHONPATH not valid "$PYTHONPATH ; exit 1 ; fi
+ while IFS=":" read -ra PPATH; do
+ for PPart in "${PPATH[@]}"; do
+ if [ ! -d $PPart ] ; then echo "PYTHONPATH not valid "$PYTHONPATH ; exit 1 ; fi
+ done
+ done <<< "$PYTHONPATH"
if [ ! -d $R_LIBS_SITE ] ; then echo "R_LIBS_SITE not valid "$R_LIBS_SITE ; exit 1 ; fi
if [ ! -d $GEM_PATH ] ; then echo "GEM_PATH not valid "$GEM_PATH ; exit 1 ; fi
fi