Skip to content

Commit

Permalink
Docker
Browse files Browse the repository at this point in the history
Fixed parsing of ROOT_PATHs containing blanks
  • Loading branch information
Salvoxia committed Aug 5, 2024
1 parent 67425b7 commit 0eab3ad
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions docker/immich_auto_album.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
#!/usr/bin/env sh

# parse comma separated root paths
root_paths=$(echo "$ROOT_PATH" | tr "," "\n")
# parse comma separated root paths and wrap in quotes
oldIFS=$IFS
IFS=','
# disable globbing
set -f
main_root_path=""
additional_root_paths=""
for path in ${root_paths}; do
for path in ${ROOT_PATH}; do
if [ -z "$main_root_path" ]; then
main_root_path="$path"
main_root_path="\"$path\""
else
additional_root_paths="-r $path $additional_root_paths"
additional_root_paths="-r \"$path\" $additional_root_paths"
fi
done
IFS=$oldIFS

unattended=
if [ ! -z "$UNATTENDED" ]; then
Expand Down

0 comments on commit 0eab3ad

Please sign in to comment.