From 4d9b1a570c9c55856c7f9dbaca117e1c1a9830c8 Mon Sep 17 00:00:00 2001
From: Andres Montano <andres.montano@tecnalia.com>
Date: Thu, 7 Nov 2024 11:11:49 +0100
Subject: [PATCH] Remove echoes

---
 dockerfiles/ros_entrypoint.sh | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/dockerfiles/ros_entrypoint.sh b/dockerfiles/ros_entrypoint.sh
index 4a33870..af538a0 100644
--- a/dockerfiles/ros_entrypoint.sh
+++ b/dockerfiles/ros_entrypoint.sh
@@ -1,5 +1,15 @@
-#!/bin/bash
+#!/usr/bin/env bash
 
-# Setup ros environment
-source "/opt/ros/$ROS_DISTRO/setup.bash"
-exec "$@"
\ No newline at end of file
+# Check if the shell is Bash or Zsh
+if [ -n "$BASH_VERSION" ]; then
+    # Bash
+    source "/opt/ros/$ROS_DISTRO/setup.bash"
+elif [ -n "$ZSH_VERSION" ]; then
+    # Zsh
+    source "/opt/ros/$ROS_DISTRO/setup.zsh"
+else
+    echo "Unknown shell. This script is designed for Bash and Zsh."
+    return 1
+fi
+
+exec "$@"
-- 
GitLab