fix: database location

Founded a major mistake: db overwrites during install.  Now all scripts save db in special folder and don't overwrite it.
This commit is contained in:
kilyabin
2025-12-04 23:44:21 +04:00
parent 3f74709513
commit 56a48b4552
9 changed files with 185 additions and 14 deletions

View File

@@ -103,6 +103,7 @@ case "$1" in
--exclude='.env.test.local' \
--exclude='*.md' \
--exclude='.dependencies.hash' \
--exclude='db/' \
"$PROJECT_DIR/" "$INSTALL_DIR/"
# Handle .env file (preserve existing if present)
@@ -113,6 +114,15 @@ case "$1" in
cp "$PROJECT_DIR/.env" "$INSTALL_DIR/.env"
fi
# Убеждаемся, что папка db существует и не перезаписывается
if [ ! -d "$INSTALL_DIR/db" ]; then
echo -e "${YELLOW}Creating db directory for database...${NC}"
mkdir -p "$INSTALL_DIR/db"
chmod 755 "$INSTALL_DIR/db"
else
echo -e "${GREEN}Database directory exists, preserving existing database${NC}"
fi
# Change to installation directory for build
cd "$INSTALL_DIR"