add hook function 'onComplete' on build

This commit is contained in:
codetypes committed 2025-03-23 22:58:49 +08:00
1 parent 645a88f661
commit 25ed8ecd56
4 files changed
+61 -97

No files matched your search

+7 -5
View File
@@ -29,11 +29,10 @@
}
interface BuildScript {
processTree?(tree: TreeModel, path: string): TreeModel | null;
processNode?(node: NodeModel, tree: TreeModel): NodeModel | null;
writeFile?(path: string, tree: TreeModel): void;
processTree?(tree: TreeModel, path: string): TreeModel | null;
processNode?(node: NodeModel, tree: TreeModel): NodeModel | null;
onWriteFile?(path: string, tree: TreeModel): void;
onComplete?(status: "success" | "failure"): void;
}
*/
({
@@ -45,4 +44,7 @@
console.log(`processNode ${tree.name} ${node.name}#${node.id}`);
return node;
},
onComplete: (status) => {
console.log(`onComplete ${status}`);
},
});