Skip to content

Commit

Permalink
Tools: Support ESP-IDF installed in system-wide shared directory for …
Browse files Browse the repository at this point in the history
…all users

Closes: #9329
Closes: #9328
  • Loading branch information
Marek Fiala committed Sep 23, 2022
1 parent c321739 commit 1e6e0cf
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 152 deletions.
8 changes: 4 additions & 4 deletions export.fish
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This script should be sourced, not executed.

# `idf_tools.py export --unset` create statement, with keyword unset, but fish shell support only `set --erase variable`
# `idf_tools.py export --deactivate` create statement, with keyword unset, but fish shell support only `set --erase variable`
function unset
set --erase $argv
end
Expand Down Expand Up @@ -28,8 +28,8 @@ function __main
"$ESP_PYTHON" "$IDF_PATH"/tools/python_version_checker.py

echo "Checking other ESP-IDF version."
set idf_unset ("$ESP_PYTHON" "$IDF_PATH"/tools/idf_tools.py export --unset) || return 1
eval "$idf_unset"
set idf_deactivate ("$ESP_PYTHON" "$IDF_PATH"/tools/idf_tools.py export --deactivate) || return 1
eval "$idf_deactivate"

echo "Adding ESP-IDF tools to PATH..."
# Call idf_tools.py to export tool paths
Expand Down Expand Up @@ -85,7 +85,7 @@ function __main
set -e ESP_PYTHON
set -e uninstall
set -e script_dir
set -e idf_unset
set -e idf_deactivate


# Not unsetting IDF_PYTHON_ENV_PATH, it can be used by IDF build system
Expand Down
6 changes: 3 additions & 3 deletions export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ __main() {
"$ESP_PYTHON" "${IDF_PATH}/tools/python_version_checker.py"

__verbose "Checking other ESP-IDF version."
idf_unset=$("$ESP_PYTHON" "${IDF_PATH}/tools/idf_tools.py" export --unset) || return 1
eval "${idf_unset}"
idf_deactivate=$("$ESP_PYTHON" "${IDF_PATH}/tools/idf_tools.py" export --deactivate) || return 1
eval "${idf_deactivate}"

__verbose "Adding ESP-IDF tools to PATH..."
# Call idf_tools.py to export tool paths
Expand Down Expand Up @@ -183,7 +183,7 @@ __cleanup() {
unset path_entry
unset IDF_ADD_PATHS_EXTRAS
unset idf_exports
unset idf_unset
unset idf_deactivate
unset ESP_PYTHON
unset SOURCE_ZSH
unset SOURCE_BASH
Expand Down
Loading

0 comments on commit 1e6e0cf

Please sign in to comment.