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 bb69439 commit 40165b7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion jit/lib/setupContext.js
Original file line number Diff line number Diff line change
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 40165b7

Please sign in to comment.