Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(world): worldgen should read system source from root dir #3027

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/twenty-trains-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@latticexyz/world": patch
---

Fixed an issue with worldgen when using a different `rootDir` from the current working directory, where worldgen would read system source files from the wrong place.
2 changes: 1 addition & 1 deletion packages/world/ts/node/render-solidity/worldgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function worldgen({

await Promise.all(
systems.map(async (system) => {
const data = await fs.readFile(system.sourcePath, "utf8");
const data = await fs.readFile(path.join(rootDir, system.sourcePath), "utf8");
// get external functions from a contract
const { functions, errors, symbolImports } = contractToInterface(data, system.label);
const imports = symbolImports.map(
Expand Down
Loading