From c9bd26a01e87c1e8d5824c326c749ced617aa314 Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Fri, 13 Apr 2018 18:31:01 +0200 Subject: [PATCH] researchSync: Fixed sending commands with newlines --- sharedPlugins/researchSync/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sharedPlugins/researchSync/index.js b/sharedPlugins/researchSync/index.js index 86c79732..4659ff5b 100644 --- a/sharedPlugins/researchSync/index.js +++ b/sharedPlugins/researchSync/index.js @@ -4,9 +4,9 @@ const needle = require("needle"); class ResearchSync { constructor(slaveConfig, messageInterface, extras = {}){ - this.functions = this.loadFunctions(); this.config = slaveConfig; this.messageInterface = messageInterface; + this.functions = this.loadFunctions(); this.research = {}; @@ -87,7 +87,7 @@ class ResearchSync { } loadFunc(path) { - return fs.readFileSync("sharedPlugins/researchSync/" + path,'utf-8').replace(/\r\n/g,' '); + return fs.readFileSync("sharedPlugins/researchSync/" + path,'utf-8').replace(/\r?\n|\r/g,' '); } scriptOutput(data){ try {