typescriptifying

This commit is contained in:
Wolfgang Hottgenroth
2018-01-08 21:54:59 +01:00
parent c1fa639ae4
commit 9e39d74084
12 changed files with 607 additions and 105 deletions

19
src/config.ts Normal file
View 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))
}