Skip to content

Commit

Permalink
Avoid exception messages while autocomplete initialization in export.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sio13 committed Nov 29, 2021
1 parent fcd634f commit 9a5d699
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ __cleanup() {
unset ESP_PYTHON
unset SOURCE_ZSH
unset SOURCE_BASH
unset WARNING_MSG

unset __realpath
unset __main
Expand Down Expand Up @@ -177,7 +178,9 @@ __enable_autocomplete() {
eval "$(env _IDF.PY_COMPLETE=$SOURCE_ZSH idf.py)" || echo "WARNING: Failed to load shell autocompletion for zsh version: $ZSH_VERSION!"
elif [ -n "${BASH_SOURCE-}" ]
then
eval "$(env LANG=en _IDF.PY_COMPLETE=$SOURCE_BASH idf.py)" || echo "WARNING: Failed to load shell autocompletion for bash version: $BASH_VERSION!"
WARNING_MSG="WARNING: Failed to load shell autocompletion for bash version: $BASH_VERSION!"
[[ ${BASH_VERSINFO[0]} -lt 4 ]] && { echo "$WARNING_MSG"; return; }
eval "$(env LANG=en _IDF.PY_COMPLETE=$SOURCE_BASH idf.py)" || echo "$WARNING_MSG"
fi
}

Expand Down

0 comments on commit 9a5d699

Please sign in to comment.