From 0ebb834c8208c885c01ee0b522baf9ef052832a0 Mon Sep 17 00:00:00 2001 From: Michael Stenta Date: Tue, 11 Aug 2020 20:09:09 -0400 Subject: [PATCH] Fix "No such file or directory" errors in docker-entrypoint.sh. --- docker/base/docker-entrypoint.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/base/docker-entrypoint.sh b/docker/base/docker-entrypoint.sh index 49229369..9f6391a6 100644 --- a/docker/base/docker-entrypoint.sh +++ b/docker/base/docker-entrypoint.sh @@ -7,14 +7,14 @@ set -e # farmOS codebase in /var/farmOS to populate them. ### -# If the /var/www/html directory is empty, copy from /var/farmOS. -if ! [ "$(ls -A /var/www/html/)" ]; then +# If the /var/www/html directory is empty, populate it from pre-built files. +if [ -d /var/www/html ] && ! [ "$(ls -A /var/www/html/)" ]; then echo "farmOS codebase not detected. Copying from pre-built files in the Docker image." cp -rp /var/farmOS/. /var/www/html fi -# If the sites directory is empty, copy from /var/farmOS/web/sites. -if ! [ "$(ls -A /var/www/html/web/sites/)" ]; then +# If the sites directory is empty, populate it from pre-built files. +if [ -d /var/www/html/web/sites ] && ! [ "$(ls -A /var/www/html/web/sites/)" ]; then echo "farmOS sites directory not detected. Copying from pre-built files in the Docker image." cp -rp /var/farmOS/web/sites/. /var/www/html/web/sites fi