setup.ps1 1.2 KB

12345678910111213141516171819202122232425262728293031
  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. _colcon_prefix_chain_powershell_source_script "/home/catalin/ros2_ws/install\local_setup.ps1"
  24. # source this prefix
  25. $env:COLCON_CURRENT_PREFIX=(Split-Path $PSCommandPath -Parent)
  26. _colcon_prefix_chain_powershell_source_script "$env:COLCON_CURRENT_PREFIX\local_setup.ps1"