Skip to content

Commit af29c97

Browse files
committed
lib.sh: resolve app paths under apps/ instead of repo root
Add APPS_ROOT=$REPO_ROOT/apps and use it in configure_app, start_app, and start_app_service. All install scripts pick up the change automatically since they call these functions. DOCKER_DATA_ROOT in install-debian.sh remains at $REPO_ROOT/docker-lib (adjacent to apps/, not inside it). Made-with: Cursor
1 parent 18d3df2 commit af29c97

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

bin/lib.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@
55
# SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
66
# REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
77
# . "$SCRIPT_DIR/lib.sh"
8+
#
9+
# App service directories are expected at $REPO_ROOT/apps/<name>.
10+
# APPS_ROOT is set automatically to $REPO_ROOT/apps.
811

912
if [ -z "$REPO_ROOT" ]; then
1013
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
1114
fi
1215

16+
APPS_ROOT="$REPO_ROOT/apps"
17+
1318
_get_system_tz() {
1419
if [ -f /etc/timezone ]; then
1520
cat /etc/timezone
@@ -21,7 +26,7 @@ _get_system_tz() {
2126
}
2227

2328
configure_app() {
24-
dir="$REPO_ROOT/$1"
29+
dir="$APPS_ROOT/$1"
2530
config_file="$2"
2631

2732
if [ -n "$config_file" ] && [ -f "$dir/config/$config_file.default" ] && [ ! -f "$dir/config/$config_file" ]; then
@@ -53,7 +58,7 @@ install_default_config() {
5358
}
5459

5560
start_app() {
56-
app_dir="$REPO_ROOT/$1"
61+
app_dir="$APPS_ROOT/$1"
5762
if ! docker compose -f "$app_dir/docker-compose.yml" ps 2>/dev/null | grep -q 'Up'; then
5863
echo "Starting $1..."
5964
docker compose -f "$app_dir/docker-compose.yml" up -d
@@ -67,7 +72,7 @@ start_app() {
6772
# services in that file untouched.
6873
# Usage: start_app_service <app_dir> <service_name>
6974
start_app_service() {
70-
app_dir="$REPO_ROOT/$1"
75+
app_dir="$APPS_ROOT/$1"
7176
service="$2"
7277
if ! docker compose -f "$app_dir/docker-compose.yml" ps "$service" 2>/dev/null | grep -q 'Up'; then
7378
echo "Starting $1/$service..."

0 commit comments

Comments
 (0)