mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Fix --help so it doesn't crash.
This commit is contained in:
parent
2d92b44f52
commit
7abae51b42
19
red/red.js
19
red/red.js
@ -33,14 +33,7 @@ var RED = {
|
|||||||
|
|
||||||
init: function(httpServer,userSettings) {
|
init: function(httpServer,userSettings) {
|
||||||
settings = userSettings;
|
settings = userSettings;
|
||||||
|
settings.version = this.version();
|
||||||
var p = require(path.join(process.env.NODE_RED_HOME,"package.json"));
|
|
||||||
if (fs.existsSync(path.join(process.env.NODE_RED_HOME,".git"))) {
|
|
||||||
settings.version = p.version+".git";
|
|
||||||
} else {
|
|
||||||
settings.version = p.version;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
server.init(httpServer,settings);
|
server.init(httpServer,settings);
|
||||||
library.init();
|
library.init();
|
||||||
@ -54,7 +47,15 @@ var RED = {
|
|||||||
credentials: credentials,
|
credentials: credentials,
|
||||||
events: events,
|
events: events,
|
||||||
log: log,
|
log: log,
|
||||||
comms:comms
|
comms: comms,
|
||||||
|
version: function () {
|
||||||
|
var p = require(path.join(process.env.NODE_RED_HOME,"package.json"));
|
||||||
|
if (fs.existsSync(path.join(process.env.NODE_RED_HOME,".git"))) {
|
||||||
|
return p.version+".git";
|
||||||
|
} else {
|
||||||
|
return p.version;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
RED.__defineGetter__("app", function() { console.log("Deprecated use of RED.app - use RED.httpAdmin instead"); return server.app });
|
RED.__defineGetter__("app", function() { console.log("Deprecated use of RED.app - use RED.httpAdmin instead"); return server.app });
|
||||||
|
Loading…
Reference in New Issue
Block a user