From ab168fe26f4ab17ad5d94851932dfd470e02a8e1 Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Mon, 4 Nov 2013 08:45:37 +0000 Subject: [PATCH] Fix paths to red to use env variable --- analysis/swearfilter/74-swearfilter.js | 12 ++++++------ io/rawserial/26-rawserial.js | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/analysis/swearfilter/74-swearfilter.js b/analysis/swearfilter/74-swearfilter.js index e1a32568..f8b445b3 100644 --- a/analysis/swearfilter/74-swearfilter.js +++ b/analysis/swearfilter/74-swearfilter.js @@ -14,15 +14,15 @@ * limitations under the License. **/ -var RED = require("../../red/red"); +var RED = require(process.env.NODE_RED_HOME+"/red/red"); var badwords = require('badwords'); function BadwordsNode(n) { - RED.nodes.createNode(this,n); - var node = this; - this.on("input", function(msg) { - if (badwords.ok(msg.payload)) { node.send(msg); } - }); + RED.nodes.createNode(this,n); + var node = this; + this.on("input", function(msg) { + if (badwords.ok(msg.payload)) { node.send(msg); } + }); } RED.nodes.registerType("badwords",BadwordsNode); diff --git a/io/rawserial/26-rawserial.js b/io/rawserial/26-rawserial.js index 9bccefac..6fcefc2d 100644 --- a/io/rawserial/26-rawserial.js +++ b/io/rawserial/26-rawserial.js @@ -14,7 +14,7 @@ * limitations under the License. **/ -var RED = require("../../red/red"); +var RED = require(process.env.NODE_RED_HOME+"/red/red"); var settings = RED.settings; var util = require("util"); var fs = require('fs');