fix: install and update script

This commit is contained in:
kilyabin
2025-11-24 02:56:59 +04:00
parent c5c6eb7875
commit 4aec72c4da
2 changed files with 22 additions and 16 deletions

View File

@@ -161,20 +161,24 @@ case "$1" in
echo -e "${YELLOW}Building application...${NC}"
npm run build
# Ensure public directory is accessible in standalone build
# Ensure public directory and static files are accessible in standalone build
echo -e "${YELLOW}Setting up static files...${NC}"
if [ -d "$INSTALL_DIR/.next/standalone" ]; then
# Copy public to standalone directory if it's not there
if [ ! -d "$INSTALL_DIR/.next/standalone/public" ]; then
# Copy public directory to standalone (always update)
if [ -d "$INSTALL_DIR/public" ]; then
echo -e "${YELLOW}Copying public directory to standalone...${NC}"
cp -r "$INSTALL_DIR/public" "$INSTALL_DIR/.next/standalone/public" 2>/dev/null || true
fi
# Ensure .next/static is accessible from standalone
if [ ! -d "$INSTALL_DIR/.next/standalone/.next" ]; then
# Copy .next/static to standalone/.next/static (always update)
if [ -d "$INSTALL_DIR/.next/static" ]; then
echo -e "${YELLOW}Copying .next/static to standalone...${NC}"
mkdir -p "$INSTALL_DIR/.next/standalone/.next"
fi
if [ ! -d "$INSTALL_DIR/.next/standalone/.next/static" ]; then
cp -r "$INSTALL_DIR/.next/static" "$INSTALL_DIR/.next/standalone/.next/static" 2>/dev/null || true
else
echo -e "${RED}Warning: .next/static directory not found!${NC}"
fi
else
echo -e "${RED}Warning: .next/standalone directory not found!${NC}"
fi
# Set ownership