Repository navigation
fix(mac-configs): resolve the seed file from the package root - #57
Merged
Merged
Conversation
SEED_PATH climbed three levels from the compiled command's directory, landing on dist/database/seeds, where tsc emits no JSON. Climb to the package root like MIGRATIONS_FOLDER does and read the seed from src/database/seeds, which exists in both source and container runs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #56.
populate-mac-configs --seedfailed on a clean build becauseSEED_PATHresolved underdist/, wheretscnever emits the JSON. That broke README setup step 4, and the same command runs on everyDockerfile.apiboot, where it failed silently: nest-commander writes command errors to stderr and exits 0, so the container started but seeding was skipped.The path now climbs to the package root and reads
src/database/seeds/mac-configs.json, the same anchorMIGRATIONS_FOLDERuses inmigrate-database.command.ts. This works from source (bun) and compiled (node) runs, and keeps--scrapewriting the tracked seed file.Verified:
dist/:bun run build:api, thenbun run db:seed:mac-configsseeds 229 Mac configurations.Dockerfile.apifor both revisions: onmaster,populate-mac-configs --seedlogsENOENTinside the image; on this branch the seed file is present and--seed --dry-runreports 229 configurations.bunx tsc --noEmitat root and inpackages/macgamingdb-server,bun run lint,bun run format:check,bun run test.