Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions tools/core-build-tasks/src/tasks/clean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ export const DEFAULT_CLEAN_DIRECTORIES = ['temp', 'lib', 'dist'];
export function cleanTask(dirs: string[]) {
return () => {
for (const dir of dirs) {
console.log(`Cleaning ${dir}`);
rimraf(path.resolve(process.cwd(), dir), () => {
// no-op on unable to clean
});
try {
console.log(`Cleaning ${dir}`);
rimraf.sync(path.resolve(process.cwd(), dir));
} catch (_: unknown) {
// File or directory did not exist, so we no-op
}
}
};
}
Loading