From 6e9fa193b7dbb3341aceb137b206a775e08dec2c Mon Sep 17 00:00:00 2001 From: Gurkirat Singh Date: Sun, 10 Jan 2021 19:22:00 +0530 Subject: [PATCH] formatted conda completion and used helper function --- completion/available/conda.completion.bash | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/completion/available/conda.completion.bash b/completion/available/conda.completion.bash index cb5a15da..51fbc2de 100644 --- a/completion/available/conda.completion.bash +++ b/completion/available/conda.completion.bash @@ -1,4 +1,12 @@ #!/usr/bin/env bash -which register-python-argcomplete > /dev/null \ - && eval "$(register-python-argcomplete conda)" \ - || echo "Please install argcomplete to use conda completion" + +if _command_exists conda +then + if _command_exists register-python-argcomplete + then + eval "$(register-python-argcomplete conda)" + else + _log_warning "Argcomplete not found. Please run 'conda install argcomplete'" + return 1 + fi +fi