1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-12-20 00:51:33 +03:00
tabby/app/lib/config.ts
2018-10-06 20:50:06 +02:00

14 lines
368 B
TypeScript

import * as fs from 'fs'
import * as path from 'path'
import * as yaml from 'js-yaml'
import { app } from 'electron'
export function loadConfig (): any {
let configPath = path.join(app.getPath('userData'), 'config.yaml')
if (fs.existsSync(configPath)) {
return yaml.safeLoad(fs.readFileSync(configPath, 'utf8'))
} else {
return {}
}
}