mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-12-23 11:55:41 +03:00
Skip removing cache dir if it doesn't exist.
This commit is contained in:
parent
87153f6a71
commit
1d07bff182
@ -90,15 +90,21 @@ async function main() {
|
||||
|
||||
function clearHttpAndPortCache() {
|
||||
const directory = ".elm-pages/http-response-cache";
|
||||
fs.readdir(directory, (err, files) => {
|
||||
if (err) throw err;
|
||||
if (fs.existsSync(directory)) {
|
||||
fs.readdir(directory, (err, files) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
for (const file of files) {
|
||||
fs.unlink(path.join(directory, file), (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
}
|
||||
});
|
||||
for (const file of files) {
|
||||
fs.unlink(path.join(directory, file), (err) => {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user