Skip to content

Commit

Permalink
Ensure cd to directory succeeds before saying it is accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuru committed Dec 31, 2024
1 parent b2d1b45 commit 94e2add
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rootfs/etc/profile.d/_50-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ function file_on_host() {
}

if [[ $SHLVL == 1 ]]; then
if [[ -d ${WORKSPACE_FOLDER:=${WORKSPACE_MOUNT}} ]]; then
if [[ -d ${WORKSPACE_FOLDER:=${WORKSPACE_MOUNT}} ]] && cd "${WORKSPACE_FOLDER}"; then
green "# Initial working directory configured as ${WORKSPACE_FOLDER}"
cd "${WORKSPACE_FOLDER}"
else
red "# Configured work directory ${WORKSPACE_FOLDER} does not appear to be accessible from this container"
fi
Expand Down

0 comments on commit 94e2add

Please sign in to comment.