From 4153351bb8d0a2a75a6d358d431e714826ed0007 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 24 Oct 2022 10:43:42 +0200 Subject: [PATCH 1/2] change(tools): export.ps1: define functions for helper python tools Follows the approach used in Initialise-Idf.ps1 created by the tools installer. This is the closes equivalent of "alias" used in export.bat Closes https://github.com/espressif/esp-idf/issues/9849 --- export.ps1 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/export.ps1 b/export.ps1 index 90217fcb93..a1e5bd6d35 100644 --- a/export.ps1 +++ b/export.ps1 @@ -51,11 +51,10 @@ foreach ($pair in $envars_array) { } # Allow calling some IDF python tools without specifying the full path -# ${IDF_PATH}/tools is already added by 'idf_tools.py export' -$IDF_ADD_PATHS_EXTRAS = ${S} + [IO.Path]::Combine(${IDF_PATH}, "components", "app_update") -$IDF_ADD_PATHS_EXTRAS += ${S} + [IO.Path]::Combine(${IDF_PATH}, "components", "espcoredump") -$IDF_ADD_PATHS_EXTRAS += ${S} + [IO.Path]::Combine(${IDF_PATH}, "components", "partition_table") -$env:PATH = $IDF_ADD_PATHS_EXTRAS + $S + $env:PATH +function idf.py { &python "$IDF_PATH\tools\idf.py" $args } +function espefuse.py { &python "$IDF_PATH\components\esptool_py\esptool\espefuse.py" $args } +function otatool.py { &python "$IDF_PATH\components\app_update\otatool.py" $args } +function parttool.py { &python "$IDF_PATH\components\partition_table\parttool.py" $args } #Compare Path's OLD vs. NEW $NEW_PATH = $env:PATH.split($S) | Select-Object -Unique # array without duplicates From c5d3f350a094c36218c0371b7cfb932cb24dec57 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 24 Oct 2022 10:44:24 +0200 Subject: [PATCH 2/2] feat(tools): add espsecure.py to the Windows export scripts This is not needed on Linux/macOS where the path to esptool directory is added to PATH. --- export.bat | 1 + export.ps1 | 1 + 2 files changed, 2 insertions(+) diff --git a/export.bat b/export.bat index f5a46cee06..8210b40c5d 100644 --- a/export.bat +++ b/export.bat @@ -49,6 +49,7 @@ if not "%PATH_ADDITIONS%"=="" echo %PATH_ADDITIONS:;=&echo. % DOSKEY idf.py=python.exe "%IDF_PATH%\tools\idf.py" $* DOSKEY esptool.py=python.exe "%IDF_PATH%\components\esptool_py\esptool\esptool.py" $* DOSKEY espefuse.py=python.exe "%IDF_PATH%\components\esptool_py\esptool\espefuse.py" $* +DOSKEY espsecure.py=python.exe "%IDF_PATH%\components\esptool_py\esptool\espsecure.py" $* DOSKEY otatool.py=python.exe "%IDF_PATH%\components\app_update\otatool.py" $* DOSKEY parttool.py=python.exe "%IDF_PATH%\components\partition_table\parttool.py" $* diff --git a/export.ps1 b/export.ps1 index a1e5bd6d35..af35dceb65 100644 --- a/export.ps1 +++ b/export.ps1 @@ -53,6 +53,7 @@ foreach ($pair in $envars_array) { # Allow calling some IDF python tools without specifying the full path function idf.py { &python "$IDF_PATH\tools\idf.py" $args } function espefuse.py { &python "$IDF_PATH\components\esptool_py\esptool\espefuse.py" $args } +function espsecure.py { &python "$IDF_PATH\components\esptool_py\esptool\espsecure.py" $args } function otatool.py { &python "$IDF_PATH\components\app_update\otatool.py" $args } function parttool.py { &python "$IDF_PATH\components\partition_table\parttool.py" $args }