Skip to content

Commit

Permalink
Fix test on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
bertdeblock committed Nov 18, 2024
1 parent 1cb6b92 commit 020bf91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { findUp } from "find-up";
import { pathToFileURL } from "node:url";
import { DocumentName, type File } from "./types.js";

type Config = {
export type Config = {
hooks?: {
postGenerate?: (info: {
documentName: DocumentName;
Expand Down
7 changes: 7 additions & 0 deletions test/blueprints/v2-addon-hooks/gember.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { writeFile } from "node:fs/promises";
import { dirname, join, relative } from "node:path";
import { fileURLToPath } from "node:url";

/** @type {import('../../../src/config.ts').Config} */
export default {
hooks: {
postGenerate: async (info) => {
Expand All @@ -13,6 +14,12 @@ export default {
file.path = relative("test/output", file.path);
}

info.files.forEach((file) => {
// Windows support:
file.content.replace("\r\n", "\n");
file.path.replace(/\\\\/g, "/");
});

await writeFile(file, JSON.stringify(info, null, 2));
},
},
Expand Down

0 comments on commit 020bf91

Please sign in to comment.