Started refactor to use typescript

This commit is contained in:
Daniel Vestøl committed 2019-03-10 14:22:08 +01:00
1 parent 9f3978e0b5
commit a4ee6f82cb
16 files changed
+264 -264

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
import * as fs from "fs"
import * as path from "path"
export function getSlaveDatabase(config: ClusterioConfig): Slaves {
var slaves: Slaves = {};
try{
let x = fs.statSync(path.resolve(config.databaseDirectory, "/slaves.json"));
console.log(`loading slaves from path.resolve(config.databaseDirectory, "slaves.json")`);
slaves = JSON.parse(fs.readFileSync(path.resolve(config.databaseDirectory, "slaves.json"), "utf-8"));
} catch (e){
slaves = {};
}
return slaves
}