typescriptifying
This commit is contained in:
19
src/config.ts
Normal file
19
src/config.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import * as fs from 'fs'
|
||||
import * as cmdargs from 'command-line-args'
|
||||
import * as logger from './log'
|
||||
|
||||
|
||||
|
||||
const OPTION_DEFINITIONS = [
|
||||
{ name: 'verbose', alias: 'v', type: Boolean },
|
||||
{ name: 'config', alias: 'c', type: String, defaultValue: '~/dispatcher_ng.conf' }
|
||||
];
|
||||
|
||||
|
||||
export let dict : any
|
||||
|
||||
export function readConfig() {
|
||||
let options = cmdargs(OPTION_DEFINITIONS)
|
||||
dict = JSON.parse(fs.readFileSync(options.config, "utf8"))
|
||||
logger.info(JSON.stringify(dict))
|
||||
}
|
Reference in New Issue
Block a user