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

Use process.env.NODE_RED_HOME to locate modules

This commit is contained in:
Nicholas O'Leary 2013-10-30 21:34:54 +00:00
parent 6a0d248f5a
commit 6f7487f393
11 changed files with 15 additions and 15 deletions

View File

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

View File

@ -14,7 +14,7 @@
* limitations under the License.
**/
var RED = require("../../red/red");
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var blinkstick = require("blinkstick");
Object.size = function(obj) {

View File

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

View File

@ -17,7 +17,7 @@
// Sample Node-RED node file
// Require main module
var RED = require("../../red/red");
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var HID = require('node-hid');
var device;
var node;

View File

@ -19,7 +19,7 @@
**/
//might need to modify accordingly
var RED = require("../../red/red");
var RED = require(process.env.NODE_RED_HOME+"/red/red");
//import noble
var noble = require('noble');

View File

@ -17,7 +17,7 @@
// Sample Node-RED node file
// Require main module
var RED = require("../../red/red");
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var SensorTag = require('sensortag');
var stag;
var node;

View File

@ -14,9 +14,9 @@
* limitations under the License.
**/
var RED = require("../../red/red");
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var growl = require('growl');
var imagefile = __dirname+"/../../public/mqtt-node-red.png";
var imagefile = process.env.NODE_RED_HOME+"/public/mqtt-node-red.png";
function NotifyNode(n) {
RED.nodes.createNode(this,n);

View File

@ -14,7 +14,7 @@
* limitations under the License.
**/
var RED = require("../../red/red");
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var Prowl = require('node-prowl');
var util = require('util');
@ -24,7 +24,7 @@ var util = require('util');
// module.exports = {prowlkey:'My-API-KEY'}
try {
var pushkey = require("../../settings").prowl || require("../../../pushkey.js");
var pushkey = require(process.env.NODE_RED_HOME+"/settings").prowl || require(process.env.NODE_RED_HOME+"/../pushkey.js");
}
catch(err) {
util.log("[57-prowl.js] Error: Failed to load Prowl credentials");

View File

@ -14,7 +14,7 @@
* limitations under the License.
**/
var RED = require("../../red/red");
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var PushBullet = require('pushbullet');
var util = require('util');
@ -24,7 +24,7 @@ var util = require('util');
// module.exports = {pushbullet:'My-API-KEY', deviceid:'12345'}
try {
var pushkey = require("../../settings").pushbullet || require("../../../pushkey.js");
var pushkey = require(process.env.NODE_RED_HOME+"/settings").pushbullet || require(process.env.NODE_RED_HOME+"/../pushkey.js");
}
catch(err) {
util.log("[57-pushbullet.js] Error: Failed to load PushBullet credentials");

View File

@ -22,12 +22,12 @@ console.warn=(function() { // suppress warning from stringprep when not needed)
};
})();
var RED = require("../../red/red");
var RED = require(process.env.NODE_RED_HOME+"/red/red");
var xmpp = require('simple-xmpp');
console.warn = orig;
try {
var xmppkey = require("../../settings").xmpp || require("../../../xmppkeys.js");
var xmppkey = require(process.env.NODE_RED_HOME+"/settings").xmpp || require(process.env.NODE_RED_HOME+"/../xmppkeys.js");
} catch(err) {
throw new Error("Failed to load XMPP credentials");
}

View File

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