fix: 🐛 make typegen.js windows compatible

This commit is contained in:
Nate Sesti 2023-08-09 19:21:57 -07:00
parent c3d62c5ae2
commit dc0622848b

View file

@ -46,8 +46,15 @@ function deleteAllInDir(dir) {
});
}
OUTPUT_DIR = "schema";
INPUT_DIR = "../schema/json";
const OUTPUT_DIR = path.join("schema");
const INPUT_DIR = path.join("..", "schema", "json");
if (!fs.existsSync(INPUT_DIR)) {
throw new Error(`Input directory does not exist: ${INPUT_DIR}`);
}
if (!fs.existsSync(OUTPUT_DIR)) {
throw new Error(`Output directory does not exist: ${OUTPUT_DIR}`);
}
deleteAllInDir(OUTPUT_DIR);
generateAllSchemas(INPUT_DIR, OUTPUT_DIR);