From 8081945405279f245b5b0971ce71a0b3153b8344 Mon Sep 17 00:00:00 2001 From: Chris Mumford Date: Tue, 2 Nov 2021 19:12:15 -0700 Subject: [PATCH] Initialize `$envvars_array` to an empty list. With strict debugging, i.e. `Set-PSDebug -strict`, execution of export.ps1 will report the following error: ``` The variable '$envars_array' cannot be retrieved because it has not been set. At C:\path\to\export.ps1:15 char:1 + $envars_array # will be filled like: + ~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (envars_array:String) [], RuntimeException + FullyQualifiedErrorId : VariableIsUndefined ``` Closes https://github.com/espressif/esp-idf/pull/7819 --- export.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export.ps1 b/export.ps1 index 2daa7575aa..4ecf066eb5 100644 --- a/export.ps1 +++ b/export.ps1 @@ -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], ... # ]