Skip to content

Commit

Permalink
fix: Check if folder has absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Oct 17, 2024
1 parent 382fd2d commit 5be8bff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fi

mount=$(echo "$resp" | jq -r '.[0].Mounts[] | select(.Destination == "/data").Source')

if [ -z "$mount" ] || [[ "$mount" == "null" ]] || [ ! -d /data ]; then
if [ -z "$mount" ] || [[ "$mount" == "null" ]] || [ ! -d "/data" ]; then
echo "ERROR: You did not bind the /data folder!" && exit 18
fi

Expand All @@ -45,6 +45,10 @@ if [[ "$mount" == *":\\"* ]]; then
mount="//${mount/:/}"
fi

if [[ "$mount" != "/"* ]]; then
echo "ERROR: Please bind the /data folder to an absolute path!" && exit 19
fi

# Mirror external folder to local filesystem
if [[ "$mount" != "/data" ]]; then
mkdir -p "$mount"
Expand Down

0 comments on commit 5be8bff

Please sign in to comment.