diff options
author | Lion Krischer <krischer@geophysik.uni-muenchen.de> | 2016-07-26 12:39:00 +0300 |
---|---|---|
committer | Lion Krischer <krischer@geophysik.uni-muenchen.de> | 2016-08-31 01:08:01 +0300 |
commit | 97e5684e5272429ae40acd4528716f64585be0a5 (patch) | |
tree | 48b2ea802b8af3805a8b828b5559b4804ae210fd | |
parent | fb211bc04cce1f3bd46a6d7c6463ef4b24691438 (diff) |
Adapting to newer conda version
-rwxr-xr-x | powerlevel9k.zsh-theme | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme index 4aeb68a4..1f3d1ad6 100755 --- a/powerlevel9k.zsh-theme +++ b/powerlevel9k.zsh-theme @@ -291,14 +291,17 @@ CURRENT_BG='NONE' # Anaconda Environment prompt_anaconda() { - if ! [ -z ${CONDA_ENV_PATH+x} ]; then + # Depending on the conda version, either might be set. This + # variant works even if both are set. + _path=$CONDA_ENV_PATH$CONDA_PREFIX + if ! [ -z "$_path" ]; then # config - can be overwritten in users' zshrc file. defined POWERLEVEL9K_ANACONDA_BG_COLOR || POWERLEVEL9K_ANACONDA_BG_COLOR=green defined POWERLEVEL9K_ANACONDA_FG_COLOR || POWERLEVEL9K_ANACONDA_FG_COLOR=black defined POWERLEVEL9K_ANACONDA_PREFIX || POWERLEVEL9K_ANACONDA_PREFIX="" defined POWERLEVEL9K_ANACONDA_LEFT_DELIMITER || POWERLEVEL9K_ANACONDA_LEFT_DELIMITER="(" defined POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER || POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER=")" - "$1_prompt_segment" "$0" "$2" "$POWERLEVEL9K_ANACONDA_BG_COLOR" "$POWERLEVEL9K_ANACONDA_FG_COLOR" "$POWERLEVEL9K_ANACONDA_PREFIX$POWERLEVEL9K_ANACONDA_LEFT_DELIMITER$(basename $CONDA_ENV_PATH)$POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER" "" + "$1_prompt_segment" "$0" "$2" "$POWERLEVEL9K_ANACONDA_BG_COLOR" "$POWERLEVEL9K_ANACONDA_FG_COLOR" "$POWERLEVEL9K_ANACONDA_PREFIX$POWERLEVEL9K_ANACONDA_LEFT_DELIMITER$(basename $_path)$POWERLEVEL9K_ANACONDA_RIGHT_DELIMITER" "" fi } |