Skip to content

Commit

Permalink
Update buildSystemsManifest.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfranblanco committed Dec 6, 2024
1 parent b819749 commit f99de9f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/world/ts/node/buildSystemsManifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ export async function buildSystemsManifest(opts: { rootDir: string; config: Worl
const forgeOutDir = await getForgeOutDirectory();
const contractArtifacts = await findContractArtifacts({ forgeOutDir });

function formatPath(path: string) {
if (path !== null) {
return path.replace(/\\/g, "/");
}
return path;
}

function getSystemArtifact(system: ResolvedSystem): ContractArtifact {
const artifact = contractArtifacts.find((a) => a.sourcePath === system.sourcePath && a.name === system.label);
const artifact = contractArtifacts.find(
(a) => formatPath(a.sourcePath) === formatPath(system.sourcePath) && a.name === system.label,
);
if (!artifact) {
throw new Error(
`Could not find build artifact for system \`${system.label}\` at \`${system.sourcePath}\`. Did \`forge build\` run successfully?`,
Expand Down

0 comments on commit f99de9f

Please sign in to comment.