Skip to content

Commit e17ebf6

Browse files
committed
fix clear cache error
1 parent 8ba5a2f commit e17ebf6

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

packages/umi-build-dev/src/plugins/commands/block/clearGitCache.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,13 @@ export default function clearGitCache(args: { dryRun?: boolean }, { log }: { log
1616
const info = `🗑 start clear: ${chalk.yellow(blocksTempPath)}`;
1717
spinner.start(info);
1818

19-
rimraf.sync(blocksTempPath, error => {
20-
if (error) {
21-
log.error(error);
22-
spinner.stop();
23-
return;
24-
}
19+
try {
20+
rimraf.sync(blocksTempPath);
2521
spinner.succeed();
26-
});
22+
} catch (error) {
23+
log.error(error);
24+
spinner.stop();
25+
}
2726

2827
return info;
2928
}

0 commit comments

Comments
 (0)