Skip to content
Permalink
Browse files

Fix: Cache file error handling on read-only file system. (fixes #11945)…

… (#11946)
  • Loading branch information...
cuki authored and mysticatea committed Jul 17, 2019
1 parent 89412c3 commit cb475fd8c0bbfcb00340459966b6780f39ea87a7
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/cli-engine/cli-engine.js
@@ -734,7 +734,10 @@ class CLIEngine {
try {
fs.unlinkSync(cacheFilePath);
} catch (error) {
if (!error || error.code !== "ENOENT") {
const errorCode = error && error.code;

// Ignore errors when no such file exists or file system is read only (and cache file does not exist)
if (errorCode !== "ENOENT" && !(errorCode === "EROFS" && !fs.existsSync(cacheFilePath))) {
throw error;
}
}

0 comments on commit cb475fd

Please sign in to comment.
You can’t perform that action at this time.