1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user