package.bash 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. # generated from colcon_bash/shell/template/package.bash.em
  2. # This script extends the environment for this package.
  3. # a bash script is able to determine its own path if necessary
  4. if [ -z "$COLCON_CURRENT_PREFIX" ]; then
  5. # the prefix is two levels up from the package specific share directory
  6. _colcon_package_bash_COLCON_CURRENT_PREFIX="$(builtin cd "`dirname "${BASH_SOURCE[0]}"`/../.." > /dev/null && pwd)"
  7. else
  8. _colcon_package_bash_COLCON_CURRENT_PREFIX="$COLCON_CURRENT_PREFIX"
  9. fi
  10. # function to source another script with conditional trace output
  11. # first argument: the path of the script
  12. # additional arguments: arguments to the script
  13. _colcon_package_bash_source_script() {
  14. if [ -f "$1" ]; then
  15. if [ -n "$COLCON_TRACE" ]; then
  16. echo ". \"$1\""
  17. fi
  18. . "$@"
  19. else
  20. echo "not found: \"$1\"" 1>&2
  21. fi
  22. }
  23. # source sh script of this package
  24. _colcon_package_bash_source_script "$_colcon_package_bash_COLCON_CURRENT_PREFIX/share/memsic_imu/package.sh"
  25. unset _colcon_package_bash_source_script
  26. unset _colcon_package_bash_COLCON_CURRENT_PREFIX