Skip to content

Commit

Permalink
Fix shellcheck issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marek Fiala committed Sep 24, 2023
1 parent 10d4c42 commit a75c94d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ __main() {
self_path="${BASH_SOURCE}"
elif [ -n "${ZSH_VERSION-}" ]
then
# shellcheck disable=SC2296 # ignore parameter starts with '{' because it's zsh
self_path="${(%):-%x}"
fi

Expand Down Expand Up @@ -138,7 +139,7 @@ __main() {

if [ -n "$BASH" ]
then
path_prefix=${PATH%%${old_path}}
path_prefix="${PATH%%"${old_path}"}"
# shellcheck disable=SC2169,SC2039 # unreachable with 'dash'
if [ -n "${path_prefix}" ]; then
__verbose "Added the following directories to PATH:"
Expand Down Expand Up @@ -173,7 +174,6 @@ __main() {
__verbose ""
__verbose " idf.py build"
__verbose ""
__verbose ""
}

__cleanup() {
Expand Down Expand Up @@ -202,7 +202,7 @@ __cleanup() {
# Not unsetting IDF_PYTHON_ENV_PATH, it can be used by IDF build system
# to check whether we are using a private Python environment

return $1
return "$1"
}


Expand All @@ -223,7 +223,7 @@ __enable_autocomplete() {
elif [ -n "${BASH_SOURCE-}" ]
then
WARNING_MSG="WARNING: Failed to load shell autocompletion for bash version: $BASH_VERSION!"
# shellcheck disable=SC3028,SC3054,SC2086 # code block for 'bash' only
# shellcheck disable=SC3028,SC3054,SC2086,SC2169 # code block for 'bash' only
[ ${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
11 changes: 6 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ while getopts ":h" option; do
h)
"${ESP_PYTHON}" "${IDF_PATH}/tools/install_util.py" print_help sh
exit;;
\?)
;;
esac
done

TARGETS=`"${ESP_PYTHON}" "${IDF_PATH}/tools/install_util.py" extract targets "$@"`
TARGETS=$("${ESP_PYTHON}" "${IDF_PATH}/tools/install_util.py" extract targets "$@")

echo "Installing ESP-IDF tools"
"${ESP_PYTHON}" "${IDF_PATH}/tools/idf_tools.py" install --targets=${TARGETS}
"${ESP_PYTHON}" "${IDF_PATH}/tools/idf_tools.py" install --targets="${TARGETS}"

FEATURES=`"${ESP_PYTHON}" "${IDF_PATH}/tools/install_util.py" extract features "$@"`
FEATURES=$("${ESP_PYTHON}" "${IDF_PATH}/tools/install_util.py" extract features "$@")

echo "Installing Python environment and packages"
"${ESP_PYTHON}" "${IDF_PATH}/tools/idf_tools.py" install-python-env --features=${FEATURES}
"${ESP_PYTHON}" "${IDF_PATH}/tools/idf_tools.py" install-python-env --features="${FEATURES}"

echo "All done! You can now run:"
echo ""
echo " . ${basedir}/export.sh"
echo ""
echo ""

0 comments on commit a75c94d

Please sign in to comment.