install.ps1 876 B

12345678910111213141516171819202122
  1. #!/usr/bin/env pwsh
  2. $IDF_PATH = $PSScriptRoot
  3. $TARGETS = (python "$IDF_PATH/tools/install_util.py" extract targets "$args")
  4. Write-Output "Installing ESP-IDF tools"
  5. $proces_tools = Start-Process -Wait -PassThru -NoNewWindow -FilePath "python" -Args "$IDF_PATH/tools/idf_tools.py install --targets=${TARGETS}"
  6. $exit_code_tools = $proces_tools.ExitCode
  7. if ($exit_code_tools -ne 0) { exit $exit_code_tools } # if error
  8. $FEATURES = (python "$IDF_PATH/tools/install_util.py" extract features "$args")
  9. Write-Output "Setting up Python environment"
  10. $proces_py_env = Start-Process -Wait -PassThru -NoNewWindow -FilePath "python" -Args "$IDF_PATH/tools/idf_tools.py install-python-env --features=${FEATURES}"
  11. $exit_code_py_env = $proces_py_env.ExitCode
  12. if ($exit_code_py_env -ne 0) { exit $exit_code_py_env } # if error
  13. Write-Output "
  14. All done! You can now run:
  15. export.ps1
  16. "