I am trying to put a source command in a bash script so that I can quickly set up and use a virtual environment when writing django websites.
I tried the following without much success as my path was not prefixed with the (path) like it does when I simply enter it at the prompt.
#!/bin/bash
current=$(pwd | cut -d'/' -f5)
source ~/Documents/virtual-env/$current/bin/activate
Can anybody help and let me know what I am overlooking?
EDIT:
pwd is "example" and the source is:
"~/Documents/virtual-env/example/bin/activate"
.
After some research I think I need to use something like:
"source ./script"
(not working) as I think the environment is created but not esculated to its parent enviroment which I believe is not possible now.
But I recommend to try virtualenvwarpper instead.