Skip to content
Merged
Prev Previous commit
Next Next commit
catch errors in case fs.rm doesn't work
  • Loading branch information
RobinMalfait committed Apr 3, 2025
commit 74ce2a064781c293f4126705181214cdf90f26ee
4 changes: 3 additions & 1 deletion integrations/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ export async function fetchStyles(base: string, path = '/'): Promise<string> {
async function gracefullyRemove(dir: string) {
// Skip removing the directory in CI because it can stall on Windows
if (!process.env.CI) {
await fs.rm(dir, { recursive: true, force: true })
await fs.rm(dir, { recursive: true, force: true }).catch((error) => {
console.log(`Failed to remove ${dir}`, error)
})
}
}