Skip to content

Commit 93b4452

Browse files
authored
Update entrypoint.sh
1 parent 0c60149 commit 93b4452

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

services/comfy/entrypoint.sh

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,14 @@ MOUNTS["${ROOT}/custom_nodes"]="/data/config/comfy/custom_nodes"
1717
MOUNTS["${ROOT}/user"]="/data/config/comfy/user"
1818

1919
for to_path in "${!MOUNTS[@]}"; do
20-
21-
from_path="${MOUNTS[$to_path]}"
22-
23-
# Make sure the source exists
24-
if [ ! -e "$from_path" ]; then
20+
from_path="${MOUNTS[${to_path}]}"
21+
rm -rf "${to_path}"
22+
if [ ! -f "$from_path" ]; then
2523
mkdir -vp "$from_path"
2624
fi
27-
28-
# If destination already exists and is not a symlink
29-
if [ -e "$to_path" ] && [ ! -L "$to_path" ]; then
30-
echo "Moving contents from $to_path -> $from_path"
31-
mv -v "$to_path"/* "$from_path"/ 2>/dev/null || true
32-
rm -rf "$to_path"
33-
fi
34-
35-
mkdir -vp "$(dirname "$to_path")"
36-
ln -sT "$from_path" "$to_path"
37-
38-
echo "Mounted $(basename "$from_path")"
39-
25+
mkdir -vp "$(dirname "${to_path}")"
26+
ln -sT "${from_path}" "${to_path}"
27+
echo Mounted $(basename "${from_path}")
4028
done
4129

4230
if [ -f "/data/config/comfy/startup.sh" ]; then

0 commit comments

Comments
 (0)