From fc9ef45293540a2a5ff8f6dde5481442f4349f0c Mon Sep 17 00:00:00 2001 From: Devendra Date: Sat, 3 May 2014 00:23:55 +0530 Subject: adding virtualenv creation and installation of dependencies to start-console --- python/examples/start-console.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) mode change 100644 => 100755 python/examples/start-console.sh (limited to 'python/examples') diff --git a/python/examples/start-console.sh b/python/examples/start-console.sh old mode 100644 new mode 100755 index 128a20e..a928cb3 --- a/python/examples/start-console.sh +++ b/python/examples/start-console.sh @@ -1,4 +1,26 @@ #!/bin/bash + +#!/bin/bash -e + +BASEDIR=. + +if [ ! -d "$BASEDIR/ve" ]; then + virtualenv -q $BASEDIR/ve --no-site-packages + $BASEDIR/ve/bin/activate + echo "Virtualenv created." +fi + +chmod 755 $BASEDIR/ve/bin/activate +$BASEDIR/ve/bin/activate + +if [ ! -f "$BASEDIR/ve/updated" -o $BASEDIR/requirements.pip -nt $BASEDIR/ve/updated ]; then + pip install -r $BASEDIR/requirements.pip -E $BASEDIR/ve + touch $BASEDIR/ve/updated + echo "Requirements installed." +fi + + + if ! type "screen" > /dev/null; then echo "[ERROR] Screen is not installed. Please install screen to use this utility ." exit -- cgit v1.2.3