Merge branch 'bugfix/ps_export_prs' into 'master'

Tools: PowerShell export script improvements from PRs

Closes IDFGH-6140, IDFGH-6141, and IDFGH-6181

See merge request espressif/esp-idf!15853
This commit is contained in:
Roland Dobai 2021-11-12 06:43:55 +00:00
commit c757dfeb7d

View File

@ -12,7 +12,7 @@ $OLD_PATH = $env:PATH.split($S) | Select-Object -Unique # array without duplicat
$envars_raw = python $IDF_PATH/tools/idf_tools.py export --format key-value
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # if error
$envars_array # will be filled like:
$envars_array = @() # will be filled like:
# [
# [vname1, vval1], [vname2, vval2], ...
# ]
@ -23,6 +23,12 @@ foreach ($line in $envars_raw) {
$envars_array += (, ($var_name, $var_val))
}
if ($IsWindows -eq $null) {
# $IsWindows was added in PowerShell Core 6 and PowerShell 7 together with multi-platform support. # I.E. if this
# internal variable is not set then PowerShell 5 is used and # the platform cannot be # anything else than Windows.
$IsWindows = $true
}
foreach ($pair in $envars_array) {
# setting the values
$var_name = $pair[0].Trim() # trim spaces on the ends of the name