Skip to content

Commit

Permalink
[ros2] more env var fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthijsBurgh committed Apr 29, 2024
1 parent ac02ddb commit 9cc8fda
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ros2/install.bash
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /usr/bin/env bash
# shellcheck disable=SC1090

# TODO(anyone): remove when tue-env is updated to new variable names
if [[ ! -v TUE_ENV_ROS_DISTRO && -v TUE_ROS_DISTRO ]]
then
TUE_ENV_ROS_DISTRO=${TUE_ROS_DISTRO}
Expand All @@ -15,10 +16,13 @@ fi
# Install basic ROS packages and eProsima DDS implementation.
tue-install-system-now ros-"${TUE_ENV_ROS_DISTRO}"-ros-core ros-"${TUE_ENV_ROS_DISTRO}"-rmw-fastrtps-cpp

# TODO(anyone): remove when tue-env is updated to new variable names
[[ -v TUE_ENV_WS_DIR || ! -v TUE_WS_DIR ]] || TUE_ENV_WS_DIR=${TUE_WS_DIR}

# Setup the build environment
mkdir -p "${TUE_ENV_WS_DIR}"

if [ ! -f "$TUE_ENV_WS_DIR"/install/setup.bash ]
if [[ ! -f "${TUE_ENV_WS_DIR}"/install/setup.bash ]]
then
[[ -v TUE_ENV_ROS_VERSION || -v TUE_ROS_VERSION ]] || { TUE_ENV_ROS_VERSION=${TUE_ROS_VERSION}; tue-install-warning "Change the config of your environment to use 'TUE_ENV_ROS_DISTRO' instead of 'TUE_ROS_DISTRO'"; }
[[ -z "${TUE_ENV_ROS_VERSION}" ]] && { tue-install-warning "tue-env variable TUE_ENV_ROS_VERSION is not set. This will not be allowed in the future.\nSetting TUE_ENV_ROS_VERSION=2 temporarily."; }
Expand Down
4 changes: 4 additions & 0 deletions ros2/setup
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#! /usr/bin/env bash

# TODO(anyone): remove when tue-env is updated to new variable names
if [[ ! -v TUE_ENV_ROS_DISTRO && -v TUE_ROS_DISTRO ]]
then
TUE_ENV_ROS_DISTRO=${TUE_ROS_DISTRO}
Expand All @@ -20,6 +21,9 @@ else
echo -e "\033[33;1m[ros2] ROS 2 ${TUE_ENV_ROS_DISTRO} setup.bash not found. \033[0m"
fi

# TODO(anyone): remove when tue-env is updated to new variable names
[[ -v TUE_ENV_WS_DIR || ! -v TUE_WS_DIR ]] || TUE_ENV_WS_DIR=${TUE_WS_DIR}

if [[ -f "${TUE_ENV_WS_DIR}/install/local_setup.bash" ]]
then
# shellcheck disable=SC1091
Expand Down

0 comments on commit 9cc8fda

Please sign in to comment.