-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoomla
More file actions
executable file
·32 lines (26 loc) · 820 Bytes
/
Copy pathjoomla
File metadata and controls
executable file
·32 lines (26 loc) · 820 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
#
# Project-local wrapper around Joomla's CLI entry point.
# Runs `php cli/joomla.php <args>` inside the `joomla` Docker Compose service.
#
# Usage:
# ./joomla <command> [options]
#
# Example:
# ./joomla origami:make --help
# ./joomla list origami
set -euo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd)"
cd "$SCRIPT_DIR"
SERVICE="joomla"
CLI_PATH="cli/joomla.php"
TTY_ARG=()
if ! { [ -t 0 ] && [ -t 1 ]; }; then
TTY_ARG=(-T)
fi
if ! docker compose ps --services --filter "status=running" 2>/dev/null | grep -qx "$SERVICE"; then
echo "Error: Docker service '$SERVICE' is not running." >&2
echo "Start it with: docker compose up -d" >&2
exit 1
fi
exec docker compose exec ${TTY_ARG[@]+"${TTY_ARG[@]}"} "$SERVICE" php "$CLI_PATH" "$@"