1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Update all core nodes to use NODE_RED_HOME rather than relative paths

This commit is contained in:
Nicholas O'Leary 2013-11-14 15:44:54 +00:00
parent 82b863805d
commit affcc8ae65
30 changed files with 32 additions and 32 deletions

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var sentiment = require('sentiment'); var sentiment = require('sentiment');
function SentimentNode(n) { function SentimentNode(n) {

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require("util"); var util = require("util");
var parseString = require('xml2js').parseString; var parseString = require('xml2js').parseString;
var gotEyes = false; var gotEyes = false;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var js2xmlparser = require("js2xmlparser"); var js2xmlparser = require("js2xmlparser");
function Js2XmlNode(n) { function Js2XmlNode(n) {

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
try { try {
var cron = require("cron"); var cron = require("cron");
} catch(err) { } catch(err) {

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require("util"); var util = require("util");
var ws = require('ws'); var ws = require('ws');

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;
var exec = require('child_process').exec; var exec = require('child_process').exec;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require("util"); var util = require("util");
var vm = require("vm"); var vm = require("vm");

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var mustache = require("mustache"); var mustache = require("mustache");
var util = require("util"); var util = require("util");

View File

@ -17,7 +17,7 @@
//Simple node to introduce a pause into a flow //Simple node to introduce a pause into a flow
//Require main module //Require main module
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var node; var node;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
function CommentNode(n) { function CommentNode(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require("util"); var util = require("util");
var firmata = require("firmata"); var firmata = require("firmata");
var arduinoReady = false; var arduinoReady = false;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require("util"); var util = require("util");
var exec = require('child_process').exec; var exec = require('child_process').exec;
var fs = require('fs'); var fs = require('fs');

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var connectionPool = require("./lib/mqttConnectionPool"); var connectionPool = require("./lib/mqttConnectionPool");
var util = require("util"); var util = require("util");

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require("util"); var util = require("util");
var http = require("http"); var http = require("http");
var https = require("https"); var https = require("https");

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var notify = require("fs.notify"); var notify = require("fs.notify");
function WatchNode(n) { function WatchNode(n) {

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var settings = RED.settings; var settings = RED.settings;
var events = require("events"); var events = require("events");
var util = require("util"); var util = require("util");

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var reconnectTime = RED.settings.socketReconnectTime||10000; var reconnectTime = RED.settings.socketReconnectTime||10000;
var net = require('net'); var net = require('net');

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var dgram = require('dgram'); var dgram = require('dgram');
// The Input Node // The Input Node

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
function HttpGet(n) { function HttpGet(n) {
RED.nodes.createNode(this,n); RED.nodes.createNode(this,n);

View File

@ -15,7 +15,7 @@
**/ **/
var util = require("util"); var util = require("util");
var mqtt = require("./mqtt"); var mqtt = require("./mqtt");
var settings = require("../../../red/red").settings; var settings = require(process.env.NODE_RED_HOME+"/red/red").settings;
var connections = {}; var connections = {};

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var operators = { var operators = {
'eq':function(a,b) { return a == b; }, 'eq':function(a,b) { return a == b; },

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var ntwitter = require('ntwitter'); var ntwitter = require('ntwitter');
var OAuth= require('oauth').OAuth; var OAuth= require('oauth').OAuth;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var FeedParser = require("feedparser"); var FeedParser = require("feedparser");
var request = require("request"); var request = require("request");

View File

@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var nodemailer = require("nodemailer"); var nodemailer = require("nodemailer");
var emailkey = require("../../../emailkeys.js"); var emailkey = require(process.env.NODE_RED_HOME+"/../emailkeys.js");
var smtpTransport = nodemailer.createTransport("SMTP",{ var smtpTransport = nodemailer.createTransport("SMTP",{
service: emailkey.service, service: emailkey.service,

View File

@ -14,13 +14,13 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var Imap = require('imap'); var Imap = require('imap');
var util = require('util'); var util = require('util');
var oldmail = {}; var oldmail = {};
try { try {
var emailkey = RED.settings.email || require("../../../emailkeys.js"); var emailkey = RED.settings.email || require(process.env.NODE_RED_HOME+"/../emailkeys.js");
} catch(err) { } catch(err) {
throw new Error("Failed to load Email credentials"); throw new Error("Failed to load Email credentials");
} }

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var irc = require("irc"); var irc = require("irc");
var util = require("util"); var util = require("util");

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var fs = require("fs"); var fs = require("fs");
var spawn = require('child_process').spawn; var spawn = require('child_process').spawn;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var fs = require("fs"); var fs = require("fs");
function FileNode(n) { function FileNode(n) {

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var util = require("util"); var util = require("util");
var redis = require("redis"); var redis = require("redis");

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
**/ **/
var RED = require("../../red/red"); var RED = require(process.env.NODE_RED_HOME+"/red/red");
var mongo = require('mongodb'); var mongo = require('mongodb');
function MongoNode(n) { function MongoNode(n) {