From fea75a0c8d9f4ced6273a6f6110f73e283f7cfc0 Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Fri, 2 Apr 2021 14:13:06 -0400 Subject: [PATCH] Don't crash if failing to remove a touch file (race condition) --- jit/lib/setupContext.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jit/lib/setupContext.js b/jit/lib/setupContext.js index 479c8ad60..9b2e5d2df 100644 --- a/jit/lib/setupContext.js +++ b/jit/lib/setupContext.js @@ -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 })