mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
Started refactor to use typescript
This commit is contained in:
1 parent
9f3978e0b5
commit
a4ee6f82cb
16 files changed
+264
-264
No files matched your search
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user