install.ps1 765 B

123456789101112131415161718192021222324252627
  1. if ($env:MSYSTEM -ne $null) {
  2. Write-Output "This .ps1 file is for Windows Powershell only. When using MSYS, run:`n. ./export.sh."
  3. exit 1
  4. }
  5. $IDF_PATH = $PSScriptRoot
  6. if($args.count -eq 0){
  7. $TARGETS = "all"
  8. }else
  9. {
  10. $TARGETS = $args[0] -join ','
  11. }
  12. Write-Output "Installing ESP-IDF tools"
  13. Start-Process -Wait -NoNewWindow -FilePath "python.exe" -Args "$IDF_PATH/tools/idf_tools.py install --targets=${TARGETS}"
  14. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # if error
  15. Write-Output "Setting up Python environment"
  16. Start-Process -Wait -NoNewWindow -FilePath "python.exe" -Args "$IDF_PATH/tools/idf_tools.py install-python-env"
  17. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE} # if error
  18. Write-Output "
  19. All done! You can now run:
  20. export.ps1
  21. "