Files
AdventureLog/scripts/lib/compose-paths.sh
Sean Morley cbe58f1160 Remove deprecated backup and deployment scripts
- 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.
2026-06-07 21:39:06 -04:00

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
}