forked from espressif/esp-idf
-
Notifications
You must be signed in to change notification settings - Fork 9
/
export.ps1
27 lines (20 loc) · 874 Bytes
/
export.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env pwsh
# 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
}
$idf_path = "$PSScriptRoot"
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")) {
Write-Output "Could not detect IDF_PATH. Please set it before running this script:"
Write-Output ' $env:IDF_PATH=(add path here)'
$env:IDF_PATH = ""
exit 1
}
$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