Skip to content

Commit

Permalink
handle more edge cases for dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed Jul 17, 2024
1 parent 9b0256b commit 9d317fd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions call_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ if [ -z "$CALL_HOST_DIR" ]; then
export CALL_HOST_STATUS=disable
fi
fi
export CALL_HOST_DIR=$(readlink -f "$CALL_HOST_DIR")
mkdir -p "$CALL_HOST_DIR"
CALL_HOST_DIR_ORIG="$CALL_HOST_DIR"
export CALL_HOST_DIR=$(readlink -f "$CALL_HOST_DIR_ORIG")
if [ -z "$CALL_HOST_DIR" ]; then
echo "Warning: readlink -f failed for CALL_HOST_DIR $CALL_HOST_DIR_ORIG. disabling"
export CALL_HOST_STATUS=disable
elif [ ! -d "$CALL_HOST_DIR" ]; then
echo "Warning: specified dir CALL_HOST_DIR $CALL_HOST_DIR does not exist. disabling"
export CALL_HOST_STATUS=disable
else
mkdir -p "$CALL_HOST_DIR"
fi
# ensure the pipe dir is bound
export APPTAINER_BIND=${APPTAINER_BIND}${APPTAINER_BIND:+,}${CALL_HOST_DIR}

Expand Down

0 comments on commit 9d317fd

Please sign in to comment.