Skip to content

Commit

Permalink
fix(embed): generate all.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Oct 12, 2024
1 parent 88cca7c commit a40ca2c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/commands/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ export async function embed(source: string, destination: string)
files.push([target, file.value]);
}

const content = eta.render("all", { files: files.map(x => x[1]) });
const target = resolve(destination, "all.hpp");

const result = await fromPromise(outputFile(target, content), as_str);

if (result.isErr())
{
console.error(`Failed to write: ${target} (${result.error})`);
return exit(1);
}

const table = files.map(([path, file]) => ({
File: file.path,
Mime: file.mime,
Expand Down

0 comments on commit a40ca2c

Please sign in to comment.