From 5a646b806722da5e4743f3808bfca18d17ba299d Mon Sep 17 00:00:00 2001 From: Alexander Grin Date: Thu, 1 Apr 2021 20:03:16 +0300 Subject: [PATCH 1/2] Add default IDF_PATH detection to export.fish Closes https://github.com/espressif/esp-idf/pull/6814 --- export.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/export.fish b/export.fish index bd15f51670..bc3f23c282 100644 --- a/export.fish +++ b/export.fish @@ -7,8 +7,8 @@ end function __main if not set -q IDF_PATH - echo "IDF_PATH must be set before sourcing this script" - return 1 + set -x IDF_PATH (cd (dirname (status -f)); and pwd) + echo "Chosen IDF_PATH: $IDF_PATH" end set script_dir (cd (dirname (status -f)); and pwd) From d558b511da8ba7df249fc5c98f4f7b1a7aae909d Mon Sep 17 00:00:00 2001 From: Marek Fiala Date: Wed, 22 Jun 2022 14:50:16 +0200 Subject: [PATCH 2/2] Tools: Auto-detect IDF_PATH in export.fish, fix setting environmental variables Edited GitHub user's change to keep the echo message consistent with other export scripts Fixed working with environmental variables in fish. pull request sha: 5a646b806722da5e4743f3808bfca18d17ba299d --- export.fish | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/export.fish b/export.fish index bc3f23c282..b112b61e07 100644 --- a/export.fish +++ b/export.fish @@ -7,8 +7,8 @@ end function __main if not set -q IDF_PATH - set -x IDF_PATH (cd (dirname (status -f)); and pwd) - echo "Chosen IDF_PATH: $IDF_PATH" + set -gx IDF_PATH (cd (dirname (status -f)); and pwd) + echo "Setting IDF_PATH to '$IDF_PATH'" end set script_dir (cd (dirname (status -f)); and pwd) @@ -36,8 +36,8 @@ function __main echo "Adding ESP-IDF tools to PATH..." # Call idf_tools.py to export tool paths - set -x IDF_TOOLS_EXPORT_CMD "$IDF_PATH"/export.fish - set -x IDF_TOOLS_INSTALL_CMD "$IDF_PATH"/install.fish + set -gx IDF_TOOLS_EXPORT_CMD "$IDF_PATH"/export.fish + set -gx IDF_TOOLS_INSTALL_CMD "$IDF_PATH"/install.fish # Allow calling some IDF python tools without specifying the full path # "$IDF_PATH"/tools is already added by 'idf_tools.py export' set IDF_ADD_PATHS_EXTRAS "$IDF_PATH"/components/esptool_py/esptool