add write file in build

This commit is contained in:
codetypes committed 2025-03-23 12:58:06 +08:00
1 parent 2483606ef4
commit 4a2116dd4f
2 files changed
+6

No files matched your search

+3
View File
@@ -100,6 +100,9 @@ if (buildOutput || buildProject || buildHelp) {
if (!b3util.checkNodeData(tree?.root)) { if (!b3util.checkNodeData(tree?.root)) {
hasError = true; hasError = true;
} }
if (buildScript?.writeFile) {
buildScript.writeFile(buildpath, tree);
}
fs.mkdirSync(Path.dirname(buildpath), { recursive: true }); fs.mkdirSync(Path.dirname(buildpath), { recursive: true });
fs.writeFileSync(buildpath, JSON.stringify(tree, null, 2)); fs.writeFileSync(buildpath, JSON.stringify(tree, null, 2));
} }
+3
View File
@@ -429,6 +429,9 @@ export const useWorkspace = create<WorkspaceStore>((set, get) => ({
if (!b3util.checkNodeData(tree?.root)) { if (!b3util.checkNodeData(tree?.root)) {
hasError = true; hasError = true;
} }
if (buildScript?.writeFile) {
buildScript.writeFile(buildpath, tree);
}
fs.mkdirSync(Path.dirname(buildpath), { recursive: true }); fs.mkdirSync(Path.dirname(buildpath), { recursive: true });
fs.writeFileSync(buildpath, JSON.stringify(tree, null, 2)); fs.writeFileSync(buildpath, JSON.stringify(tree, null, 2));
}); });