2020-05-13 08:00:38 -04:00
|
|
|
#!/usr/bin/env pwsh
|
2020-07-21 08:47:27 -04:00
|
|
|
|
2024-08-21 10:34:19 -04:00
|
|
|
# Emergency backup option to use previous export.ps1 (export_legacy.ps1) if the new export approach fails.
|
|
|
|
# To use it, set environmental variable like: $Env:ESP_IDF_LEGACY_EXPORT=1
|
|
|
|
if ($env:ESP_IDF_LEGACY_EXPORT) {
|
|
|
|
. ./tools/legacy_exports/export_legacy.ps1
|
|
|
|
exit $LASTEXITCODE
|
|
|
|
}
|
|
|
|
|
2024-06-21 11:13:18 -04:00
|
|
|
$idf_path = "$PSScriptRoot"
|
2019-08-27 01:45:50 -04:00
|
|
|
|
2024-06-21 11:13:18 -04:00
|
|
|
if (-not (Test-Path "$idf_path/tools/idf.py") -or
|
|
|
|
-not (Test-Path "$idf_path/tools/idf_tools.py") -or
|
|
|
|
-not (Test-Path "$idf_path/tools/activate.py")) {
|
2019-08-27 01:45:50 -04:00
|
|
|
|
2024-06-21 11:13:18 -04:00
|
|
|
Write-Output "Could not detect IDF_PATH. Please set it before running this script:"
|
|
|
|
Write-Output ' $env:IDF_PATH=(add path here)'
|
2022-02-15 12:36:46 -05:00
|
|
|
|
2024-06-21 11:13:18 -04:00
|
|
|
$env:IDF_PATH = ""
|
2019-08-27 01:45:50 -04:00
|
|
|
|
2024-06-21 11:13:18 -04:00
|
|
|
exit 1
|
2019-08-27 01:45:50 -04:00
|
|
|
}
|
|
|
|
|
2024-06-21 11:13:18 -04:00
|
|
|
$idf_exports = python "$idf_path/tools/activate.py" --export
|
|
|
|
# The dot sourcing is added here in PowerShell since
|
|
|
|
# Win PSAnalyzer complains about using `Invoke-Expression` command
|
|
|
|
. $idf_exports
|