2020-03-16 09:22:43 -04:00
|
|
|
# This script should be sourced, not executed.
|
|
|
|
|
2022-08-09 12:13:29 -04:00
|
|
|
# `idf_tools.py export --deactivate` create statement, with keyword unset, but fish shell support only `set --erase variable`
|
2021-11-08 11:55:03 -05:00
|
|
|
function unset
|
|
|
|
set --erase $argv
|
|
|
|
end
|
|
|
|
|
2024-08-21 10:34:19 -04:00
|
|
|
# Emergency backup option to use previous export.fish (export_legacy.fish) if the new export approach fails.
|
|
|
|
# To use it, set environmental variable like: export ESP_IDF_LEGACY_EXPORT=1
|
|
|
|
if test -n "$ESP_IDF_LEGACY_EXPORT"
|
|
|
|
source tools/legacy_exports/export_legacy.fish
|
|
|
|
exit $status
|
|
|
|
end
|
|
|
|
|
2024-06-21 11:13:18 -04:00
|
|
|
set idf_path (dirname (realpath (status -f)))
|
|
|
|
|
|
|
|
if not test -f "$idf_path/tools/idf.py"
|
|
|
|
or not test -f "$idf_path/tools/idf_tools.py"
|
|
|
|
or not test -f "$idf_path/tools/activate.py"
|
|
|
|
echo "Could not detect IDF_PATH. Please set it before sourcing this script:"
|
|
|
|
echo " export IDF_PATH=(add path here)"
|
|
|
|
set -e idf_path
|
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
|
|
|
|
source "$idf_path"/tools/detect_python.fish
|
|
|
|
|
|
|
|
eval ("$idf_path"/tools/activate.py --export)
|
|
|
|
set -e idf_path
|