Allow user to pass custom CSS file

This commit is contained in:
TC
2022-08-21 23:36:02 +02:00
parent a8301f44be
commit ef6fb402bf
2 changed files with 24 additions and 1 deletions

View File

@ -32,9 +32,16 @@ module.exports.listenAction = (channel, callback) => {
return ipcMain.on(channel, callback);
};
module.exports.fileExists = (path, callbackIfExists) => {
module.exports.fileExists = (
path,
callbackIfExists,
callbackIfError = undefined
) => {
fs.access(path, fs.F_OK, (err) => {
if (err) {
if (callbackIfError) {
callbackIfError();
}
return;
}