tools: {export,install}.sh: fix quoting issues

This commit is contained in:
Ivan Grokhotkov 2020-10-09 17:40:57 +02:00
parent 79f2e68bc0
commit a038fb24bd
2 changed files with 12 additions and 8 deletions

View File

@ -111,16 +111,19 @@ __main() {
then
path_prefix=${PATH%%${old_path}}
# shellcheck disable=SC2169,SC2039 # unreachable with 'dash'
paths="${path_prefix//:/ }"
if [ -n "${paths}" ]; then
if [ -n "${path_prefix}" ]; then
__verbose "Added the following directories to PATH:"
else
__verbose "All paths are already set."
fi
for path_entry in ${paths}
old_ifs="$IFS"
IFS=":"
for path_entry in ${path_prefix}
do
__verbose " ${path_entry}"
done
IFS="$old_ifs"
unset old_ifs
else
__verbose "Updated PATH variable:"
__verbose " ${PATH}"

View File

@ -3,10 +3,12 @@
set -e
set -u
export IDF_PATH=$(cd $(dirname $0); pwd)
basedir=$(dirname "$0")
IDF_PATH=$(cd "${basedir}"; pwd)
export IDF_PATH
echo "Detecting the Python interpreter"
. ${IDF_PATH}/tools/detect_python.sh
. "${IDF_PATH}/tools/detect_python.sh"
if [ "$#" -eq 0 ]; then
TARGETS="all"
@ -14,12 +16,11 @@ else
TARGETS=$1
fi
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}
echo "Installing Python environment and packages"
${ESP_PYTHON} ${IDF_PATH}/tools/idf_tools.py install-python-env
"${ESP_PYTHON}" "${IDF_PATH}/tools/idf_tools.py" install-python-env
basedir="$(dirname $0)"
echo "All done! You can now run:"
echo ""
echo " . ${basedir}/export.sh"