setup.ps1 1.1 KB

1234567891011121314151617181920212223242526272829
  1. # generated from colcon_powershell/shell/template/prefix_chain.ps1.em
  2. # This script extends the environment with the environment of other prefix
  3. # paths which were sourced when this file was generated as well as all packages
  4. # contained in this prefix path.
  5. # function to source another script with conditional trace output
  6. # first argument: the path of the script
  7. function _colcon_prefix_chain_powershell_source_script {
  8. param (
  9. $_colcon_prefix_chain_powershell_source_script_param
  10. )
  11. # source script with conditional trace output
  12. if (Test-Path $_colcon_prefix_chain_powershell_source_script_param) {
  13. if ($env:COLCON_TRACE) {
  14. echo ". '$_colcon_prefix_chain_powershell_source_script_param'"
  15. }
  16. . "$_colcon_prefix_chain_powershell_source_script_param"
  17. } else {
  18. Write-Error "not found: '$_colcon_prefix_chain_powershell_source_script_param'"
  19. }
  20. }
  21. # source chained prefixes
  22. _colcon_prefix_chain_powershell_source_script "/opt/ros/humble\local_setup.ps1"
  23. # source this prefix
  24. $env:COLCON_CURRENT_PREFIX=(Split-Path $PSCommandPath -Parent)
  25. _colcon_prefix_chain_powershell_source_script "$env:COLCON_CURRENT_PREFIX\local_setup.ps1"