mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
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:
commit
c757dfeb7d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user