tabby/app/lib/config.ts

14 lines
370 B
TypeScript
Raw Normal View History

2018-10-06 18:50:06 +00:00
import * as fs from 'fs'
import * as path from 'path'
import * as yaml from 'js-yaml'
import { app } from 'electron'
export function loadConfig (): any {
2020-12-24 13:03:14 +00:00
const configPath = path.join(app.getPath('userData'), 'config.yaml')
2018-10-06 18:50:06 +00:00
if (fs.existsSync(configPath)) {
return yaml.safeLoad(fs.readFileSync(configPath, 'utf8'))
} else {
return {}
}
}