mirror of
https://github.com/zadam/trilium.git
synced 2024-11-12 02:37:39 +08:00
21 lines
No EOL
613 B
JavaScript
21 lines
No EOL
613 B
JavaScript
"use strict";
|
|
|
|
const ini = require('ini');
|
|
const fs = require('fs');
|
|
const dataDir = require('./data_dir');
|
|
const path = require('path');
|
|
const resource_dir = require('./resource_dir');
|
|
|
|
const configSampleFilePath = path.resolve(resource_dir.RESOURCE_DIR, "config-sample.ini");
|
|
|
|
const configFilePath = dataDir.TRILIUM_DATA_DIR + '/config.ini';
|
|
|
|
if (!fs.existsSync(configFilePath)) {
|
|
const configSample = fs.readFileSync(configSampleFilePath).toString('utf8');
|
|
|
|
fs.writeFileSync(configFilePath, configSample);
|
|
}
|
|
|
|
const config = ini.parse(fs.readFileSync(configFilePath, 'utf-8'));
|
|
|
|
module.exports = config; |