Add support of subflow env var

This commit is contained in:
Hiroyasu Nishiyama
2019-01-26 23:15:20 +09:00
parent 4baaaa8d59
commit a413f3cded
13 changed files with 835 additions and 24 deletions

View File

@@ -158,9 +158,7 @@ module.exports = function(RED) {
},
env: {
get: function(envVar) {
// For now, just return the env var. This will eventually
// also return project settings and subflow instance properties
return process.env[envVar]
return node.getenv(envVar);
}
},
setTimeout: function () {

View File

@@ -94,7 +94,7 @@ module.exports = function(RED) {
this.error(RED._("change.errors.invalid-expr",{error:e.message}));
}
} else if (rule.tot === 'env') {
rule.to = RED.util.evaluateNodeProperty(rule.to,'env');
rule.to = RED.util.evaluateNodeProperty(rule.to,'env',node);
}
}