Don't crash if failing to remove a touch file (race condition)

This commit is contained in:
Adam Wathan 2021-04-02 14:13:06 -04:00
parent d541742774
commit fea75a0c8d

View file

@ -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 })