fix(build): runtime 清理失败时回退 shell rm -rf
避免 macOS 上 pnpm node_modules 树导致 ENOTEMPTY 阻断发布构建。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -65,7 +65,13 @@ async function exists(targetPath) {
|
||||
}
|
||||
|
||||
async function remove(targetPath) {
|
||||
await fs.rm(targetPath, { recursive: true, force: true });
|
||||
if (!(await exists(targetPath))) return;
|
||||
try {
|
||||
await fs.rm(targetPath, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
||||
} catch (error) {
|
||||
if (error?.code !== 'ENOTEMPTY' && error?.code !== 'EBUSY') throw error;
|
||||
await run('rm', ['-rf', targetPath]);
|
||||
}
|
||||
}
|
||||
|
||||
async function copyDir(source, target) {
|
||||
|
||||
Reference in New Issue
Block a user