20 lines
428 B
JavaScript
20 lines
428 B
JavaScript
|
const fs = require('fs')
|
||
|
const path = require('path')
|
||
|
const toml = require('toml')
|
||
|
const filename = path.join(__dirname, 'client.config.toml')
|
||
|
const pkg = require(path.join(__dirname, 'package.json'))
|
||
|
|
||
|
let config
|
||
|
|
||
|
try {
|
||
|
config = toml.parse(fs.readFileSync(filename))
|
||
|
} catch (e) {
|
||
|
console.error(e)
|
||
|
process.exit(1)
|
||
|
}
|
||
|
|
||
|
config.client.version = pkg.version
|
||
|
config.client.description = pkg.description
|
||
|
|
||
|
module.exports = config
|