Fixed writing of files

master
Felix Stupp 6 years ago
parent 50231d4cd3
commit 3dcdaa9560

@ -7,8 +7,8 @@ module.exports = (app) => {
function renderAndSave(file, template, options) {
file = path.join(staticDir, file);
app.render(template, options, (e, r) => {
if (e) return fs.writeFile(file, "<!DOCTYPE html><html><head><title>Something went wrong!</title></head><body><h1>Something went wrong!</h1><p>Could not render this page! Please contact the administrator!</p></body></html>");
return fs.writeFile(file, r);
if (e) return fs.writeFile(file, "<!DOCTYPE html><html><head><title>Something went wrong!</title></head><body><h1>Something went wrong!</h1><p>Could not render this page! Please contact the administrator!</p></body></html>", () => undefined);
return fs.writeFile(file, r, () => undefined);
});
}

Loading…
Cancel
Save