Skip to content

Commit

Permalink
fix(world): worldgen should read system source from root dir (#3027)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Aug 13, 2024
1 parent 5cee9a0 commit 542ea54
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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

0 comments on commit 542ea54

Please sign in to comment.