diff --git a/app/init.sh b/app/init.sh index 25d700d..8726900 100644 --- a/app/init.sh +++ b/app/init.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + echo "Initializing" USERNAME="www-data" @@ -24,12 +26,14 @@ mkhomedir_helper $USERNAME mkdir -p /var/www/bearpass -if [ ! -d "/var/www/bearpass/vendor" ] -then - echo "Downloading vendor deps..." +vendor_deps_status=$(composer install --no-dev --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --dry-run 2>&1 | grep "Nothing to install, update or remove") +if [[ -z $vendor_deps_status ]]; then + echo "Downloading / updating vendor deps..." cd /var/www/bearpass && \ composer install --no-dev -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist && \ composer dump-autoload +else + echo "Vendor deps are up-to-date" fi if [ ! -f "/var/www/bearpass/.env" ] diff --git a/cron/init.sh b/cron/init.sh index a155427..45076f4 100644 --- a/cron/init.sh +++ b/cron/init.sh @@ -1,5 +1,7 @@ #!/bin/bash +set -e + USERNAME="www-data" GROUPNAME="www-data" diff --git a/nginx/init.sh b/nginx/init.sh index ce17043..8bcfb01 100644 --- a/nginx/init.sh +++ b/nginx/init.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + USERNAME="www-data" GROUPNAME="www-data"