From 4153351bb8d0a2a75a6d358d431e714826ed0007 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 24 Oct 2022 10:43:42 +0200 Subject: [PATCH] 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 90217fcb937..a1e5bd6d355 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