mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 03:29:37 +02:00
Fixed bug with custom css not persisting
This commit is contained in:
parent
4143ae8198
commit
88785aaa32
5 changed files with 40 additions and 12 deletions
22
utils/findCss.js
Normal file
22
utils/findCss.js
Normal file
|
@ -0,0 +1,22 @@
|
|||
const fs = require('fs');
|
||||
const { join } = require('path');
|
||||
const Logger = require('./Logger');
|
||||
const logger = new Logger();
|
||||
|
||||
// Check if flame.css exists in mounted docker volume. Create new file if not
|
||||
const findCss = () => {
|
||||
const srcPath = join(__dirname, '../data/flame.css');
|
||||
const destPath = join(__dirname, '../public/flame.css');
|
||||
|
||||
if (fs.existsSync(srcPath)) {
|
||||
fs.copyFileSync(srcPath, destPath);
|
||||
logger.log('Custom CSS file found');
|
||||
return;
|
||||
}
|
||||
|
||||
logger.log('Creating empty CSS file');
|
||||
fs.writeFileSync(destPath, '');
|
||||
|
||||
}
|
||||
|
||||
module.exports = findCss;
|
Loading…
Add table
Add a link
Reference in a new issue