Move clusterioMod file creation

Move the creation of the output.txt, orders.txt and txbuffer.txt script
output files out of the client.js code and into the clusterioMod.
This commit is contained in:
Hornwitser committed 2019-10-14 15:51:45 +02:00
1 parent 3202e2d150
commit 2ff52a1cf2
3 files changed
+10 -6

No files matched your search

+10
View File
@@ -10,6 +10,12 @@ const getLua = require("lib/clusterTools/getLua");
const pluginConfig = require("./config");
const COMPRESS_LUA = false;
function ensureFileSync(path) {
if (!fs.existsSync(path)) {
fs.outputFileSync(path, "");
}
}
module.exports = class remoteCommands {
constructor(mergedConfig, messageInterface, extras){
this.messageInterface = messageInterface;
@@ -27,6 +33,10 @@ module.exports = class remoteCommands {
'x-access-token': this.config.masterAuthToken
},
};
ensureFileSync(instancedirectory + "/script-output/output.txt");
ensureFileSync(instancedirectory + "/script-output/orders.txt");
ensureFileSync(instancedirectory + "/script-output/txbuffer.txt");
(async ()=>{
let hotpatchInstallStatus = await checkHotpatchInstallation(this.messageInterface);