Compare commits

..

4 Commits

Author SHA1 Message Date
Nick O'Leary
9ec7bb8d41 bump version 2016-06-20 21:38:09 +01:00
Nick O'Leary
2b9bfbc309 MQTT In subscription qos not defaulting properly 2016-06-20 21:35:43 +01:00
Dave Conway-Jones
e50d04077b Let exec node handle 0 as well as "0" 2016-06-20 19:28:59 +01:00
Nick O'Leary
b6fcaacb77 Create default settings.js in the user-specified directory
Fixes #908
2016-06-20 14:41:47 +01:00
5 changed files with 18 additions and 8 deletions

View File

@@ -1,3 +1,11 @@
#### 0.14.3: Maintenance Release
Fixes
- Create default setting.js in user-specified directory. Fixes #908
- MQTT In subscription qos not defaulting properly
- Let exec node handle 0 as well as "0"
#### 0.14.2: Maintenance Release
Fixes

View File

@@ -29,6 +29,7 @@ module.exports = function(RED) {
this.useSpawn = n.useSpawn;
this.timer = Number(n.timer || 0)*1000;
this.activeProcesses = {};
var node = this;
var cleanup = function(p) {
//console.log("CLEANUP!!!",p);
@@ -37,7 +38,6 @@ module.exports = function(RED) {
node.error("Exec node timeout");
}
var node = this;
this.on("input", function(msg) {
var child;
node.status({fill:"blue",shape:"dot",text:" "});
@@ -45,8 +45,8 @@ module.exports = function(RED) {
// make the extra args into an array
// then prepend with the msg.payload
var arg = node.cmd;
if (node.addpay) { arg += " "+msg.payload; }
arg += " "+node.append;
if ((node.addpay === true) && msg.hasOwnProperty("payload")) { arg += " "+msg.payload; }
if (node.append.trim() !== "") { arg += " "+node.append; }
// slice whole line by spaces (trying to honour quotes);
arg = arg.match(/(?:[^\s"]+|"[^"]*")+/g);
var cmd = arg.shift();
@@ -88,7 +88,7 @@ module.exports = function(RED) {
}
else {
var cl = node.cmd;
if ((node.addpay === true) && ((msg.payload || "").toString().trim() !== "")) { cl += " "+msg.payload; }
if ((node.addpay === true) && msg.hasOwnProperty("payload")) { cl += " "+msg.payload; }
if (node.append.trim() !== "") { cl += " "+node.append; }
/* istanbul ignore else */
if (RED.settings.verbose) { node.log(cl); }

View File

@@ -314,8 +314,10 @@ module.exports = function(RED) {
function MQTTInNode(n) {
RED.nodes.createNode(this,n);
this.topic = n.topic;
this.qos = parseInt(n.qos===undefined?"2":n.qos);
this.qos = parseInt(n.qos);
if (isNaN(this.qos) || this.qos < 0 || this.qos > 2) {
this.qos = 2;
}
this.broker = n.broker;
this.brokerConn = RED.nodes.getNode(this.broker);
if (!/^(#$|(\+|[^+#]*)(\/(\+|[^+#]*))*(\/(\+|#|[^+#]*))?$)/.test(this.topic)) {

View File

@@ -1,6 +1,6 @@
{
"name" : "node-red",
"version" : "0.14.2",
"version" : "0.14.3",
"description" : "A visual tool for wiring the Internet of Things",
"homepage" : "http://nodered.org",
"license" : "Apache-2.0",

2
red.js
View File

@@ -81,7 +81,7 @@ if (parsedArgs.settings) {
// NODE_RED_HOME contains user data - use its settings.js
settingsFile = path.join(process.env.NODE_RED_HOME,"settings.js");
} else {
var userDir = path.join(parsedArgs.userDir || process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,".node-red");
var userDir = parsedArgs.userDir || path.join(process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,".node-red");
var userSettingsFile = path.join(userDir,"settings.js");
if (fs.existsSync(userSettingsFile)) {
// $HOME/.node-red/settings.js exists