Skip to content
This repository was archived by the owner on Sep 10, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,45 +31,45 @@ echo " Decompression complete"

if [ -n "$APP_BASE" ] && [ "$APP_BASE" != "/" ]; then
echo "Injecting APP_BASE='${APP_BASE}' into built files..."

# Handle nested paths (e.g., /level1/level2)
if [ -d "/app/build/client/__PLACEHOLDER__" ]; then
TARGET_DIR="/app/build/client/${APP_BASE_NO_SLASH}"
PARENT_DIR=$(dirname "$TARGET_DIR")

# Create parent directories if path has multiple segments
if [ "$PARENT_DIR" != "/app/build/client" ]; then
mkdir -p "$PARENT_DIR"
echo " Created parent directories: $PARENT_DIR"
fi

mv /app/build/client/__PLACEHOLDER__ "$TARGET_DIR"
echo " Moved client assets to ${APP_BASE_NO_SLASH}"
fi

# Step 2: Replace placeholder in ALL text files (now decompressed)
find /app/build -type f \( -name "*.js" -o -name "*.html" -o -name "*.css" -o -name "*.json" -o -name "*.map" \) \
-exec sed -i "s|${PLACEHOLDER}|${APP_BASE}|g" {} + 2>/dev/null || true
find /app/build -type f \( -name "*.js" -o -name "*.json" -o -name "*.map" \) \
-exec sed -i "s|__PLACEHOLDER__|${APP_BASE_NO_SLASH}|g" {} + 2>/dev/null || true

echo "Path injection complete"
else
# Root path - remove placeholder
echo "Configuring for root path..."

if [ -d "/app/build/client/__PLACEHOLDER__" ]; then
mv /app/build/client/__PLACEHOLDER__/* /app/build/client/ 2>/dev/null || true
rmdir /app/build/client/__PLACEHOLDER__ 2>/dev/null || true
echo " Moved client assets to root"
fi

# Step 2: Replace placeholder in ALL text files (now decompressed)
find /app/build -type f \( -name "*.js" -o -name "*.html" -o -name "*.css" -o -name "*.json" -o -name "*.map" \) \
-exec sed -i "s|${PLACEHOLDER}||g" {} + 2>/dev/null || true
find /app/build -type f \( -name "*.js" -o -name "*.json" -o -name "*.map" \) \
-exec sed -i "s|__PLACEHOLDER__/||g" {} + 2>/dev/null || true

echo "Root path configuration complete"
fi

Expand Down
Loading
Loading