feat(tools): Added Windows shells support + refactoring

This commit is contained in:
Marek Fiala
2024-06-21 17:13:18 +02:00
parent 1c22f6c4e8
commit 88527faff8
14 changed files with 694 additions and 640 deletions

View File

@@ -28,20 +28,18 @@ fi
if [ ! -f "${idf_path}/tools/idf.py" ] ||
[ ! -f "${idf_path}/tools/idf_tools.py" ] ||
[ ! -f "${idf_path}/activate.py" ]
[ ! -f "${idf_path}/tools/activate.py" ]
then
# Echo command here is not used for printing to the terminal, but as non-empty return value from function.
echo "Could not detect IDF_PATH. Please set it before sourcing this script:"
echo " export IDF_PATH=(add path here)"
unset idf_path
return 1
fi
# TODO Maybe we can use "command -v" to check just for python and python3
. "${idf_path}/tools/detect_python.sh"
# Evaluate the ESP-IDF environment set up by the activate.py script.
idf_exports=$("$ESP_PYTHON" "${idf_path}/activate.py" --export)
idf_exports=$("$ESP_PYTHON" "${idf_path}/tools/activate.py" --export)
eval "${idf_exports}"
unset idf_path
return 0