Skip to content
Snippets Groups Projects
Commit f165a664 authored by Montaño Sarria, Andres Felipe's avatar Montaño Sarria, Andres Felipe
Browse files

Fix Issue with SHELL

parent d141045b
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ ENV ROS_DISTRO "${ROS_DISTRO}"
ARG EXT_SHELL=bash
ENV EXT_SHELL "${EXT_SHELL}"
ENV SHELL="/bin/${SHELL}"
ENV SHELL "/bin/${EXT_SHELL}"
RUN echo "Building devenv for ROS" $ROS_DISTRO "with shell" $EXT_SHELL
# Avoid warnings by switching to noninteractive
......@@ -123,10 +123,6 @@ RUN chmod a+x /ros_entrypoint.sh
# Set running in docker for zsh powerlevel10k
ENV RUNNING_IN_DOCKER true
# Set extra environment variables for ROS2
ENV ROS_LOCALHOST_ONLY=1
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
# Define entrypoint and command
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD $EXT_SHELL
......@@ -142,7 +138,7 @@ ENV DEBIAN_FRONTEND=
FROM devenv as workspace-extended
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND noninteractive
# Install extra packages ws_dependencies
ARG PACKAGES=none
......@@ -198,3 +194,7 @@ RUN apt-get update \
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=
# Define entrypoint and command
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD $EXT_SHELL
#!/usr/bin/env bash
# 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
source "/opt/ros/$ROS_DISTRO/setup.bash"
exec "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment