mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Fixed test autocompletion
This commit is contained in:
parent
a9a8fd03b6
commit
e66fec955e
@ -67,6 +67,12 @@ end
|
|||||||
|
|
||||||
idf_export_main
|
idf_export_main
|
||||||
|
|
||||||
eval (env _IDF.PY_COMPLETE=source_fish idf.py)
|
set click_version (python -c 'import click; print(click.__version__.split(".")[0])')
|
||||||
|
if test $click_version -lt 8
|
||||||
|
eval (env _IDF.PY_COMPLETE=source_fish idf.py)
|
||||||
|
else
|
||||||
|
eval (env _IDF.PY_COMPLETE=fish_source idf.py)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
set -e idf_export_main
|
set -e idf_export_main
|
||||||
|
17
export.sh
17
export.sh
@ -141,14 +141,27 @@ idf_export_main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enable_autocomplete() {
|
enable_autocomplete() {
|
||||||
|
click_version="$(python -c 'import click; print(click.__version__.split(".")[0])')"
|
||||||
|
if [[ click_version -lt 8 ]]
|
||||||
|
then
|
||||||
|
SOURCE_ZSH=source_zsh
|
||||||
|
SOURCE_BASH=source_bash
|
||||||
|
else
|
||||||
|
SOURCE_ZSH=zsh_source
|
||||||
|
SOURCE_BASH=bash_source
|
||||||
|
fi
|
||||||
if [ -n "${ZSH_VERSION-}" ]
|
if [ -n "${ZSH_VERSION-}" ]
|
||||||
then
|
then
|
||||||
autoload -Uz compinit && compinit -u
|
autoload -Uz compinit && compinit -u
|
||||||
eval "$(env _IDF.PY_COMPLETE=source_zsh idf.py)" || echo "WARNING: Failed to load shell autocompletion!"
|
eval "$(env _IDF.PY_COMPLETE=$SOURCE_ZSH idf.py)" || echo "WARNING: Failed to load shell autocompletion!"
|
||||||
elif [ -n "${BASH_SOURCE-}" ]
|
elif [ -n "${BASH_SOURCE-}" ]
|
||||||
then
|
then
|
||||||
eval "$(env _IDF.PY_COMPLETE=source_bash idf.py)" || echo "WARNING: Failed to load shell autocompletion!"
|
eval "$(env _IDF.PY_COMPLETE=$SOURCE_BASH idf.py)" || echo "WARNING: Failed to load shell autocompletion!"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
unset SOURCE_ZSH
|
||||||
|
unset SOURCE_BASH
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
idf_export_main
|
idf_export_main
|
||||||
|
Loading…
Reference in New Issue
Block a user