ENH allow zsh-conda to accept init script as arg
This commit is contained in:
parent
8e8723ff64
commit
2d4160b9bd
|
@ -449,14 +449,22 @@ zsh-rbenv () {
|
||||||
|
|
||||||
{{ if .development.conda -}}
|
{{ if .development.conda -}}
|
||||||
zsh-conda () {
|
zsh-conda () {
|
||||||
if [[ -x $XDG_DATA_HOME/mambaforge/bin/conda ]]; then
|
if [ -n "$1" ]; then
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
source "$1"
|
||||||
|
else
|
||||||
|
echo "Could not source file at $1"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
elif [ -x $XDG_DATA_HOME/mambaforge/bin/conda ]; then
|
||||||
eval "$($XDG_DATA_HOME/mambaforge/bin/conda shell.zsh hook)"
|
eval "$($XDG_DATA_HOME/mambaforge/bin/conda shell.zsh hook)"
|
||||||
alias cdd="conda deactivate"
|
|
||||||
alias cda="conda activate"
|
|
||||||
alias cde="conda env"
|
|
||||||
alias cdl="conda list"
|
|
||||||
else
|
else
|
||||||
echo "conda installation not found"
|
echo "conda installation not found"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
|
alias cdd="conda deactivate"
|
||||||
|
alias cda="conda activate"
|
||||||
|
alias cde="conda env"
|
||||||
|
alias cdl="conda list"
|
||||||
}
|
}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
Loading…
Reference in New Issue