mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
fixing default configs
This commit is contained in:
@@ -3,6 +3,8 @@ import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { nanoid } from 'nanoid';
|
||||
import logger from '../../../logger.js';
|
||||
import { DEFAULT_CONFIG } from '../../../../defaultConfig.js';
|
||||
import { getDirName } from '../../../../utils.js';
|
||||
|
||||
export function up(db) {
|
||||
db.exec(`
|
||||
@@ -67,6 +69,10 @@ export function up(db) {
|
||||
'analyticsEnabled',
|
||||
config.analyticsEnabled != null ? config.analyticsEnabled : defaults.analyticsEnabled,
|
||||
);
|
||||
|
||||
//now making sure only sqlite path remains in the config
|
||||
const sqlitepath = config.sqlitepath || DEFAULT_CONFIG.sqlitepath;
|
||||
fs.writeFileSync(`${getDirName()}/../conf/config.json`, JSON.stringify({ sqlitepath }));
|
||||
} catch (e) {
|
||||
logger.error(e);
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ function compileSettings(rows, configValues) {
|
||||
config[r.name] = parsed && typeof parsed === 'object' && 'value' in parsed ? parsed.value : parsed;
|
||||
}
|
||||
return {
|
||||
...config,
|
||||
...configValues,
|
||||
...config,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user