From efaa4374ec382f01c0c609496d98c5fa29cce800 Mon Sep 17 00:00:00 2001 From: DonRichards Date: Wed, 18 Oct 2023 14:36:50 -0400 Subject: [PATCH] Fix directory check --- custom.Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom.Makefile b/custom.Makefile index c006d7b68..c4e4b771d 100644 --- a/custom.Makefile +++ b/custom.Makefile @@ -114,20 +114,20 @@ jhu_up: jhu_generate-secrets fi @echo "docker-compose.yml does not exist, creating starter site" $(MAKE) starter-init ENVIRONMENT=starter_dev - if [ -z "$$(ls -A $(QUOTED_CURDIR)/codebase)" ]; then \ + if [ ! -z "$$(ls -A $(QUOTED_CURDIR)/codebase)" ]; then \ echo "codebase/ directory is empty, cloning it"; \ docker container run --rm -v $(CURDIR)/codebase:/home/root $(REPOSITORY)/nginx:$(TAG) with-contenv bash -lc 'git clone -b main https://github.com/jhu-idc/idc-codebase /home/root;'; \ fi $(MAKE) set-codebase-owner $(MAKE) set-files-owner SRC=$(CURDIR)/codebase ENVIRONMENT=starter_dev docker-compose up -d --remove-orphans - docker-compose exec -T drupal with-contenv bash -lc 'git config --global --add safe.directory /var/www/drupal/web/modules/contrib/islandora_fits' # The rest of this should be moved into another function. @echo "Wait for the /var/www/drupal directory to be available" - while ! docker compose exec -T drupal with-contenv bash -lc 'test -d /var/www/drupal'; do \ + while ! docker compose exec -T drupal with-contenv bash -lc 'test -f /var/www/drupal/composer.json'; do \ echo "Waiting for /var/www/drupal directory to be available..."; \ sleep 2; \ done + docker-compose exec -T drupal with-contenv bash -lc 'git config --global --add safe.directory /var/www/drupal/web/modules/contrib/islandora_fits' docker-compose exec -T drupal with-contenv bash -lc 'rm -rf vendor/ web/modules/contrib/* web/themes/contrib/*' docker compose exec -T drupal with-contenv bash -lc 'chown -R nginx:nginx /var/www/drupal/ && su nginx -s /bin/bash -c "composer install"' $(MAKE) set-codebase-owner