This commit is contained in:
2026-04-30 17:49:07 +08:00
parent 805d6f8cae
commit 9d684cb7b3
615 changed files with 15368 additions and 6172 deletions

View File

@@ -100,8 +100,15 @@ async function recreateTempDir(dir) {
async function replaceGeneratedDir(fromDir, toDir) {
assertInside(toDir, REPO_ROOT, '仓库生成目录');
await rm(toDir, {recursive: true, force: true});
await mkdir(path.dirname(toDir), {recursive: true});
await cp(fromDir, toDir, {recursive: true});
await mkdir(toDir, {recursive: true});
const entries = await readdir(fromDir, {withFileTypes: true});
for (const entry of entries) {
await cp(path.join(fromDir, entry.name), path.join(toDir, entry.name), {
recursive: true,
force: true,
});
}
}
function assertInside(candidate, parent, label) {
@@ -171,12 +178,12 @@ function run(command, commandArgs) {
return;
}
if (output.includes('Could not format generated files')) {
reject(new Error(`${command} 生成后格式化失败。`));
return;
}
if (code === 0) {
if (output.includes('Could not format generated files')) {
console.warn(
`[spacetime:generate] ${command} 已生成 bindings但 formatter 受限未执行;继续同步生成文件。`,
);
}
resolve();
return;
}