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