Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ztraboo
Created April 22, 2020 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ztraboo/59464e192efa96917deecf783cf148c8 to your computer and use it in GitHub Desktop.
Save ztraboo/59464e192efa96917deecf783cf148c8 to your computer and use it in GitHub Desktop.
.bash_profile (Macbook Pro)
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
edxenv() {
# Update environmental variables when switching release.
RELEASE='master'
if [ -z "$1" ] || [ "$1" = "master" ]; then
export DEVSTACK_WORKSPACE=/Users/ztraboo/Dev/EducateWorkforce/Repos/open-edx/devstack.master
# Remove this variable because the `/devstack/repo.sh` command checks for this for an named release.
unset OPENEDX_RELEASE
else
RELEASE=$1
export DEVSTACK_WORKSPACE=/Users/ztraboo/Dev/EducateWorkforce/Repos/open-edx/devstack.${RELEASE}
export OPENEDX_RELEASE=${RELEASE}.master
fi
cd "$DEVSTACK_WORKSPACE"
if [ $? -eq 0 ]; then
echo "Moved to the $RELEASE workspace"
cd "devstack"
if [ $? -eq 0 ]; then
if [ ! -d "venv" ]; then
virtualenv venv
fi
export VIRTUAL_ENV=${DEVSTACK_WORKSPACE}/devstack/venv
deactivate
source venv/bin/activate
echo "Activated the 'venv' for ${RELEASE} in the 'devstack' repo."
fi
echo "Set these environment variables:"
export PWD=$DEVSTACK_WORKSPACE
export OLDPWD=$DEVSTACK_WORKSPACE
echo "DEVSTACK_WORKSPACE = ${DEVSTACK_WORKSPACE}"
echo "OPENEDX_RELEASE = ${OPENEDX_RELEASE}"
echo "VIRTUAL_ENV = ${DEVSTACK_WORKSPACE}/devstack/venv"
echo "PWD = ${DEVSTACK_WORKSPACE}"
echo "OLDPWD = ${DEVSTACK_WORKSPACE}"
which python
else
echo "Could not find $RELEASE workspace. Make sure to create this directory before issuing this command."
unset DEVSTACK_WORKSPACE
unset OPENEDX_RELEASE
deactivate
fi
}
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:~/Library/Python/3.6/bin:${PATH}"
export PATH
# Make 'pip3' the default for 'pip'
# https://stackoverflow.com/questions/44455001/how-to-change-pip3-command-to-be-pip/54903907
alias pip='pip3'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment