From 5d716d8a0d4c5fba48e8b203e23760d5cfb5d2d3 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 12 Aug 2026 15:39:11 -0700 Subject: [PATCH] manage, only copy example files and run scripts if a proper docker compose file exists. --- bin/manage.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/manage.sh b/bin/manage.sh index 95e5eac..8952f53 100755 --- a/bin/manage.sh +++ b/bin/manage.sh @@ -151,13 +151,13 @@ if [[ -n $up || -n $down || -n $build || -n $pull || -n $maintenance ]]; then pwd # Ensure env file exists so that all compose variables are populated. - if [[ -e ./example.env && ! -e ./.env ]]; then + if [[ -e "./example.env" && ! -e "./.env" && -f "docker-compose.yml" ]]; then echo "WARNING: .env file was not found, copying example as placeholder." cp -v example.env .env fi # Ensure all configuration files have been created. - if [[ -d ./config ]]; then + if [[ -d "./config" && -f "docker-compose.yml" ]]; then ls ./config/*.example 2>/dev/null | while read example; do real=${example//.example/} if [[ ! -e $real ]]; then @@ -168,12 +168,12 @@ if [[ -n $up || -n $down || -n $build || -n $pull || -n $maintenance ]]; then fi # Run the prep script to create any necessary volumes. - if [[ -f prep.sh ]]; then + if [[ -f "prep.sh" && -f "docker-compose.yml" ]]; then ./prep.sh fi - # Run any maintenance scripts associate with the container. - if [[ "$maintenance" == "Y" ]]; then + # Run any maintenance scripts associated with the container. + if [[ "$maintenance" == "Y" && -f "docker-compose.yml" ]]; then if [[ -f "maintenance.sh" ]]; then ./maintenance.sh fi