From 1d0bf940e47c11e2c5e37a31479f75f62cee2ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurenz=20Altenm=C3=BCller?= Date: Wed, 15 Oct 2025 12:51:49 +0200 Subject: [PATCH] Make launch.sh Posix shell compliant --- ros2/ament.bzl | 2 +- ros2/launch.sh.tpl | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ros2/ament.bzl b/ros2/ament.bzl index 9f69f0db..8f41c874 100644 --- a/ros2/ament.bzl +++ b/ros2/ament.bzl @@ -346,7 +346,7 @@ def _sh_launcher_rule_impl(ctx): ctx.attr.substitutions, { "{{ament_prefix_path}}": ament_prefix_path, - "{{bash_bin}}": ctx.toolchains[SH_TOOLCHAIN].path, + "{{sh_bin}}": ctx.toolchains[SH_TOOLCHAIN].path, }, ) diff --git a/ros2/launch.sh.tpl b/ros2/launch.sh.tpl index 7ca8d963..ab6f5792 100644 --- a/ros2/launch.sh.tpl +++ b/ros2/launch.sh.tpl @@ -1,13 +1,13 @@ -#!{{bash_bin}} +#!{{sh_bin}} -set -o errexit -o nounset -o pipefail +set -eu -if [[ ! -z "${BAZEL_TEST:-}" ]]; then +if [ -n "${BAZEL_TEST:-}" ]; then bazel_test_output_dir="${TEST_UNDECLARED_OUTPUTS_DIR:-${TEST_TMPDIR}}" - if [[ -z "${ROS_HOME:-}" ]]; then + if [ -z "${ROS_HOME:-}" ]; then export ROS_HOME="${bazel_test_output_dir}" fi - if [[ -z "${ROS_LOG_DIR:-}" ]]; then + if [ -z "${ROS_LOG_DIR:-}" ]; then export ROS_LOG_DIR="${bazel_test_output_dir}" fi fi