fix: update code

This commit is contained in:
Daniel
2026-03-03 17:54:43 +08:00
parent 1764a44eb3
commit 0cbeaf59a5
6 changed files with 156 additions and 12 deletions

View File

@@ -20,7 +20,14 @@ echo "==> Checking crawler Python deps..."
pip install -q -r crawler/requirements.txt 2>/dev/null || true
echo "==> Seeding database (if needed)..."
[ ! -f server/data.db ] && npm run api:seed
# 若指定了 DB_PATH则以 DB_PATH 为准;否则默认使用 server/data.db
DB_FILE_PATH="${DB_PATH:-server/data.db}"
if [ ! -f "$DB_FILE_PATH" ]; then
echo " - DB file not found at $DB_FILE_PATH, running api:seed once"
npm run api:seed
else
echo " - Existing DB detected at $DB_FILE_PATH, skip seeding"
fi
echo "==> Starting API (http://localhost:3001)..."
npm run api &