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
pull/11287/merge
Ivan Grokhotkov 2022-10-24 10:43:42 +02:00 zatwierdzone przez Marek Fiala
rodzic 22cfbf30c3
commit 01d4c4740a
1 zmienionych plików z 4 dodań i 5 usunięć

Wyświetl plik

@ -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