mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
Merge branch 'bugfix/ps_export_prs_v4.3' into 'release/v4.3'
Tools: PowerShell export script improvements from PRs (v4.3) See merge request espressif/esp-idf!15924
This commit is contained in:
@ -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
|
$envars_raw = python $IDF_PATH/tools/idf_tools.py export --format key-value
|
||||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # if error
|
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # if error
|
||||||
|
|
||||||
$envars_array # will be filled like:
|
$envars_array = @() # will be filled like:
|
||||||
# [
|
# [
|
||||||
# [vname1, vval1], [vname2, vval2], ...
|
# [vname1, vval1], [vname2, vval2], ...
|
||||||
# ]
|
# ]
|
||||||
@ -23,6 +23,12 @@ foreach ($line in $envars_raw) {
|
|||||||
$envars_array += (, ($var_name, $var_val))
|
$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) {
|
foreach ($pair in $envars_array) {
|
||||||
# setting the values
|
# setting the values
|
||||||
$var_name = $pair[0].Trim() # trim spaces on the ends of the name
|
$var_name = $pair[0].Trim() # trim spaces on the ends of the name
|
||||||
|
Reference in New Issue
Block a user