mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-07-31 07:49:07 -04:00
- Deleted the backup.sh and deploy.sh scripts as they are no longer needed. - Updated documentation to reflect the removal of these scripts and their functionalities. - Cleaned up related GitHub Actions workflows to remove references to the deleted scripts.
29 lines
834 B
Bash
29 lines
834 B
Bash
#!/bin/bash
|
|
# Resolve Docker Compose file paths (supports docker/ layout and legacy locations).
|
|
COMPOSE_DIR="${COMPOSE_DIR:-docker}"
|
|
|
|
resolve_compose_file() {
|
|
local filename="$1"
|
|
if [[ -f "$filename" ]]; then
|
|
printf '%s\n' "$filename"
|
|
elif [[ -f "${COMPOSE_DIR}/${filename}" ]]; then
|
|
printf '%s\n' "${COMPOSE_DIR}/${filename}"
|
|
elif [[ -f "compose/${filename}" ]]; then
|
|
printf '%s\n' "compose/${filename}"
|
|
else
|
|
printf '%s\n' "${COMPOSE_DIR}/${filename}"
|
|
fi
|
|
}
|
|
|
|
default_compose_file() {
|
|
local aio_file
|
|
aio_file="$(resolve_compose_file "docker-compose.aio.yml")"
|
|
if [[ -f .env.aio ]] && [[ ! -f .env ]]; then
|
|
printf '%s\n' "$aio_file"
|
|
elif [[ -f .env.aio ]] && [[ -f "$aio_file" ]] && [[ "${ADVENTURELOG_COMPOSE:-}" == "aio" ]]; then
|
|
printf '%s\n' "$aio_file"
|
|
else
|
|
resolve_compose_file "docker-compose.yml"
|
|
fi
|
|
}
|