Created
March 26, 2018 19:02
-
-
Save OAkyildiz/bb70418a3cbabbbd2a13138901921f30 to your computer and use it in GitHub Desktop.
Enable conda, add it to the path, optionally activate an environment and remove other packages from PYTHONPATH or vice-versa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [ "$CONDA" == true ] ; then | |
if ! [ -z $CONDA_DEFAULT_ENV ] && ! [ "$CONDA_DEFAULT_ENV" == "root" ] ; then | |
echo "Deactivating ${CONDA_DEFAULT_ENV} first" | |
source deactivate | |
fi | |
export PATH=$NOCONDA_PATH | |
export PYTHONPATH=$ROS_PYTHON:$PYTHONPATH | |
export CONDA=false | |
echo -e "\e[38;5;82mConda down! \e[0m" | |
else | |
export NOCONDA_PATH=$PATH | |
export PATH=/opt/anaconda3/bin:$PATH | |
export CONDA=true | |
echo -e "\e[38;5;82mSnakes on the plane! \e[0m" | |
if [ -z $2 ]; then | |
export ROS_PYTHON_PKGS=$PYTHONPATH | |
unset PYTHONPATH | |
fi | |
if ! [ -z $1 ]; then | |
echo "activating ${1}" | |
source activate $1 | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment