diff --git a/ros1/install.bash b/ros1/install.bash index 4585d245b..fc4cea988 100644 --- a/ros1/install.bash +++ b/ros1/install.bash @@ -1,14 +1,15 @@ #! /usr/bin/env bash # shellcheck disable=SC1090 -if [ -z "$TUE_ROS_DISTRO" ] +[[ -v TUE_ENV_ROS_DISTRO || -v TUE_ROS_DISTRO ]] || { TUE_ENV_ROS_DISTRO=${TUE_ROS_DISTRO}; tue-install-warning "Change the config of your environment to use 'TUE_ENV_ROS_DISTRO' instead of 'TUE_ROS_DISTRO'"; } +if [[ -z "${TUE_ENV_ROS_DISTRO}" ] then - tue-install-error "TUE_ROS_DISTRO was not set" + tue-install-error "TUE_ENV_ROS_DISTRO was not set" return 1 fi # Install basic ROS packages. -tue-install-system-now ros-"$TUE_ROS_DISTRO"-ros +tue-install-system-now ros-"${TUE_ENV_ROS_DISTRO}"-ros if [ ! -d /etc/ros/rosdep ] then @@ -19,16 +20,16 @@ rosdep_update_file="/tmp/tue_rosdep_update_${USER}" if [ ! -f "$rosdep_update_file" ] then tue-install-debug "Updating rosdep" - tue-install-pipe rosdep update --rosdistro "$TUE_ROS_DISTRO" + tue-install-pipe rosdep update --rosdistro "${TUE_ENV_ROS_DISTRO}" touch "$rosdep_update_file" fi -mkdir -p "$TUE_SYSTEM_DIR" +mkdir -p "${TUE_ENV_WS_DIR}" -if [ ! -f "$TUE_SYSTEM_DIR"/devel/setup.bash ] +if [ ! -f "${TUE_ENV_WS_DIR}"/devel/setup.bash ] then - [[ -z "${TUE_ROS_VERSION}" ]] && { tue-install-warning "tue-env variable TUE_ROS_VERSION is not set. This will not be allowed in the future.\nSetting TUE_ROS_VERSION=1 temporarily."; } + [[ -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" # shellcheck disable=SC2086 - TUE_ROS_VERSION=1 tue-make${status_args} || tue-install-error "Error in building the system workspace" + TUE_ENV_ROS_VERSION=1 tue-make${status_args} || tue-install-error "Error in building the system workspace" fi diff --git a/ros1/setup b/ros1/setup index 6cc4e254e..6d0b5976c 100644 --- a/ros1/setup +++ b/ros1/setup @@ -1,19 +1,20 @@ #! /usr/bin/env bash -if [ -z "$TUE_ROS_DISTRO" ] +[[ -v TUE_ENV_ROS_DISTRO || -v TUE_ROS_DISTRO ]] || { TUE_ENV_ROS_DISTRO=${TUE_ROS_DISTRO}; >&2 echo "Change the config of your environment to use 'TUE_ENV_ROS_DISTRO' instead of 'TUE_ROS_DISTRO'"; } +if [[ -z "${TUE_ENV_ROS_DISTRO}" ]] then - echo -e "\e[31;1m[ros] TUE_ROS_DISTRO was not set\e[0m" + echo -e "\e[31;1m[ros] TUE_ENV_ROS_DISTRO was not set\e[0m" return 1 fi -if [ -f "$TUE_SYSTEM_DIR"/devel/setup.bash ] +if [ -f "${TUE_ENV_WS_DIR}"/devel/setup.bash ] then # shellcheck disable=SC1091 - source "$TUE_SYSTEM_DIR"/devel/setup.bash + source "${TUE_ENV_WS_DIR}"/devel/setup.bash else echo -e "\e[33;1m[ros] system workspaces not found, sourcing /opt/ros\e[0m" # shellcheck disable=SC1090 - source /opt/ros/"$TUE_ROS_DISTRO"/setup.bash + source /opt/ros/"${TUE_ENV_ROS_DISTRO}"/setup.bash fi # Set ROSCONSOLE_FORMAT