Make FactorioServer.exampleSettings static

Convert the exampleSettings method to be a static method.
This commit is contained in:
Hornwitser committed 2019-11-30 00:08:10 +01:00
1 parent 039b41d3e6
commit a3eb39712c
3 files changed
+5 -4

No files matched your search

+3 -2
View File
@@ -753,10 +753,11 @@ class FactorioServer extends events.EventEmitter {
*
* Loads server-settings.example.json from the data dir.
*
* @param {string} dataDir - The data directory for Factorio
* @returns {object} the parsed server-settings.
*/
async exampleSettings() {
return JSON.parse(await fs.readFile(this.dataPath("server-settings.example.json"), "utf-8"));
static async exampleSettings(dataDir) {
return JSON.parse(await fs.readFile(path.join(dataDir, "server-settings.example.json"), "utf-8"));
}
async _writeConfigIni() {