Skip to content

Commit

Permalink
Don't crash if failing to remove a touch file (race condition)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwathan committed Apr 2, 2021
1 parent d541742 commit fea75a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jit/lib/setupContext.js
Expand Up @@ -36,7 +36,9 @@ const touchDir =
if (!sharedState.env.TAILWIND_DISABLE_TOUCH) {
if (fs.existsSync(touchDir)) {
for (let file of fs.readdirSync(touchDir)) {
fs.unlinkSync(path.join(touchDir, file))
try {
fs.unlinkSync(path.join(touchDir, file))
} catch (_err) {}
}
} else {
fs.mkdirSync(touchDir, { recursive: true })
Expand Down

0 comments on commit fea75a0

Please sign in to comment.