From c65ed1ab557730c2520481b4cd6f7c66d4c29fad Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Sun, 22 Dec 2024 14:52:42 +0100 Subject: [PATCH] dist/tools/esptools: make export.sh more helpful --- dist/tools/esptools/export.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dist/tools/esptools/export.sh b/dist/tools/esptools/export.sh index d415ac2a92..425978a77c 100755 --- a/dist/tools/esptools/export.sh +++ b/dist/tools/esptools/export.sh @@ -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}")" - 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 + 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 }