Skip to content

Commit

Permalink
dist/tools/esptools: make export.sh more helpful
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Dec 22, 2024
1 parent ffe844f commit c65ed1a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dist/tools/esptools/export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,20 @@ export_arch()
TOOLS_DIR="${TOOLS_PATH}/${TARGET_ARCH}/${ESP32_GCC_RELEASE}/${TARGET_ARCH}"
TOOLS_DIR_IN_PATH="$(echo $PATH | grep "${TOOLS_DIR}")"

Check warning on line 39 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

if [ -e "${TOOLS_DIR}" ] && [ -z "${TOOLS_DIR_IN_PATH}" ]; then
if [ ! -e "${TOOLS_DIR}" ]; then
echo "${TOOLS_DIR} does not exist - please run"
echo $(echo $0 | sed 's/export/install/') $1

Check warning on line 43 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

Check warning on line 43 in dist/tools/esptools/export.sh

View workflow job for this annotation

GitHub Actions / static-tests

Quote this to prevent word splitting. [SC2046]
exit 1
fi

if [ -z "${TOOLS_DIR_IN_PATH}" ]; then
echo "Extending PATH by ${TOOLS_DIR}/bin"
export PATH="${TOOLS_DIR}/bin:${PATH}"
fi

echo "To make this permanent, add this line to your ~/.bashrc or ~/.profile:"
echo PATH="\$PATH:${TOOLS_DIR}/bin"

unset TOOLS_DIR
}

Expand Down

0 comments on commit c65ed1a

Please sign in to comment.