Skip to content

Commit

Permalink
change(tools): export.ps1: define functions for helper python tools
Browse files Browse the repository at this point in the history
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 #9849
  • Loading branch information
igrr authored and Marek Fiala committed Aug 2, 2023
1 parent 6db7b11 commit 4153351
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions export.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4153351

Please sign in to comment.