install.ps1 982 B

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