empty cache dir before quit (#478)

This commit is contained in:
an-lee
2024-04-02 14:49:48 +08:00
committed by GitHub
parent 071d80060d
commit f536643215

View File

@@ -1,5 +1,6 @@
import { app, BrowserWindow, protocol, net } from "electron";
import path from "path";
import fs from "fs-extra";
import settings from "@main/settings";
import "@main/i18n";
import mainWindow from "@main/window";
@@ -88,5 +89,9 @@ app.on("activate", () => {
}
});
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and import them here.
// Clean up cache folder before quit
app.on("before-quit", () => {
try {
fs.emptyDirSync(settings.cachePath());
} catch (err) {}
});