install.ps1 628 B

12345678910111213141516171819202122
  1. #!/usr/bin/env pwsh
  2. $IDF_PATH = $PSScriptRoot
  3. if($args.count -eq 0){
  4. $TARGETS = "all"
  5. }else
  6. {
  7. $TARGETS = $args[0] -join ','
  8. }
  9. Write-Output "Installing ESP-IDF tools"
  10. Start-Process -Wait -NoNewWindow -FilePath "python" -Args "$IDF_PATH/tools/idf_tools.py install --targets=${TARGETS}"
  11. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # if error
  12. Write-Output "Setting up Python environment"
  13. Start-Process -Wait -NoNewWindow -FilePath "python" -Args "$IDF_PATH/tools/idf_tools.py install-python-env"
  14. if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE} # if error
  15. Write-Output "
  16. All done! You can now run:
  17. export.ps1
  18. "