nutrition: fix embedding file paths for production and copy to dist
All checks were successful
CI / update (push) Successful in 4m42s

resolve() uses CWD which in production (adapter-node) is dist/, not the
project root. Detect the correct data directory at startup and add a
postbuild step to copy the embedding JSON files into dist/data/.
This commit is contained in:
2026-04-02 21:08:53 +02:00
parent 61336823b3
commit 433477e2c6
3 changed files with 8 additions and 38 deletions

View File

@@ -1,35 +0,0 @@
#!/bin/bash
# Update all files importing from the legacy $lib/db/db to use $utils/db instead
files=(
"/home/alex/.local/src/homepage/src/routes/mario-kart/[id]/+page.server.ts"
"/home/alex/.local/src/homepage/src/routes/mario-kart/+page.server.ts"
"/home/alex/.local/src/homepage/src/routes/api/fitness/sessions/[id]/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/fitness/sessions/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/fitness/templates/[id]/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/fitness/templates/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/fitness/exercises/[id]/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/fitness/exercises/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/fitness/exercises/filters/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/fitness/seed-example/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/mario-kart/tournaments/[id]/groups/[groupId]/scores/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/mario-kart/tournaments/[id]/groups/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/mario-kart/tournaments/[id]/contestants/[contestantId]/dnf/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/mario-kart/tournaments/[id]/contestants/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/mario-kart/tournaments/[id]/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/mario-kart/tournaments/[id]/bracket/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/mario-kart/tournaments/[id]/bracket/matches/[matchId]/scores/+server.ts"
"/home/alex/.local/src/homepage/src/routes/api/mario-kart/tournaments/+server.ts"
)
for file in "${files[@]}"; do
if [ -f "$file" ]; then
echo "Updating $file"
sed -i "s/from '\$lib\/db\/db'/from '\$utils\/db'/g" "$file"
else
echo "File not found: $file"
fi
done
echo "All files updated!"