mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Assume -d params are strings if they don't otherwise parse
This commit is contained in:
parent
c0f4e07e10
commit
c8f6100a6a
7
packages/node_modules/node-red/red.js
vendored
7
packages/node_modules/node-red/red.js
vendored
@ -153,7 +153,12 @@ if (parsedArgs.define) {
|
|||||||
var match = /^(([^=]+)=(.+)|@(.*))$/.exec(def);
|
var match = /^(([^=]+)=(.+)|@(.*))$/.exec(def);
|
||||||
if (match) {
|
if (match) {
|
||||||
if (!match[4]) {
|
if (!match[4]) {
|
||||||
var val = JSON.parse(match[3]);
|
var val = match[3];
|
||||||
|
try {
|
||||||
|
val = JSON.parse(match[3]);
|
||||||
|
} catch(err) {
|
||||||
|
// Leave it as a string
|
||||||
|
}
|
||||||
RED.util.setObjectProperty(settings, match[2], val, true);
|
RED.util.setObjectProperty(settings, match[2], val, true);
|
||||||
} else {
|
} else {
|
||||||
var obj = fs.readJsonSync(match[4]);
|
var obj = fs.readJsonSync(match[4]);
|
||||||
|
Loading…
Reference in New Issue
Block a user