Skip to content

Commit

Permalink
[ros1] 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 d9a8728 commit ac02ddb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ros1/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 Down Expand Up @@ -28,9 +29,12 @@ then
touch "$rosdep_update_file"
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}

mkdir -p "${TUE_ENV_WS_DIR}"

if [ ! -f "${TUE_ENV_WS_DIR}"/devel/setup.bash ]
if [[ ! -f "${TUE_ENV_WS_DIR}"/devel/setup.bash ]]
then
[[ -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=1 temporarily."; }
[[ "$CI" == "true" ]] && status_args=" --no-status"
Expand Down
6 changes: 5 additions & 1 deletion ros1/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 @@ -11,7 +12,10 @@ then
return 1
fi

if [ -f "${TUE_ENV_WS_DIR}"/devel/setup.bash ]
# 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}"/devel/setup.bash ]]
then
# shellcheck disable=SC1091
source "${TUE_ENV_WS_DIR}"/devel/setup.bash
Expand Down

0 comments on commit ac02ddb

Please sign in to comment.