Autodetect "source" for activating virtualenv commands in bash
This commit is contained in:
parent
ca6d9e3a9f
commit
9a4cd139ed
|
@ -4,16 +4,15 @@
|
||||||
#
|
#
|
||||||
# Run by using the following command: "source virtualenv_install.sh"
|
# Run by using the following command: "source virtualenv_install.sh"
|
||||||
|
|
||||||
|
[[ $0 != "$BASH_SOURCE" ]] && sourced=1 || sourced=0
|
||||||
|
if [ $sourced = 1 ]
|
||||||
|
then
|
||||||
python -m pip install --upgrade virtualenv
|
python -m pip install --upgrade virtualenv
|
||||||
python -m pip install --upgrade virtualenvwrapper
|
python -m pip install --upgrade virtualenvwrapper
|
||||||
source `which virtualenvwrapper.sh`
|
source `which virtualenvwrapper.sh`
|
||||||
export WORKON_HOME=$HOME/.virtualenvs
|
export WORKON_HOME=$HOME/.virtualenvs
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
echo 'virtualenv commands will only work if you installed this using "source":'
|
|
||||||
echo ' *** "source virtualenv_install.sh" ***'
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
echo "*** You may now use virtualenv commands in your command shell. ***"
|
echo "*** You may now use virtualenv commands in your command shell. ***"
|
||||||
echo ""
|
echo ""
|
||||||
echo "virtualenv commands:"
|
echo "virtualenv commands:"
|
||||||
|
@ -26,3 +25,15 @@ echo ""
|
||||||
echo "Example:"
|
echo "Example:"
|
||||||
echo " mkvirtualenv seleniumbase "
|
echo " mkvirtualenv seleniumbase "
|
||||||
echo ""
|
echo ""
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo "--------------------"
|
||||||
|
echo '*** - WARNING! - ***'
|
||||||
|
echo "--------------------"
|
||||||
|
echo ""
|
||||||
|
echo 'You need to "source" this file for virtualenv commands to work!'
|
||||||
|
echo ""
|
||||||
|
echo '*** USE: source virtualenv_install.sh'
|
||||||
|
echo " ----------------------------"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue