mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Add flowFilePretty option
This commit is contained in:
parent
fce00b2f4b
commit
749eaa2181
@ -181,7 +181,16 @@ var localfilesystem = {
|
|||||||
if (fs.existsSync(flowsFullPath)) {
|
if (fs.existsSync(flowsFullPath)) {
|
||||||
fs.renameSync(flowsFullPath,flowsPrev);
|
fs.renameSync(flowsFullPath,flowsPrev);
|
||||||
}
|
}
|
||||||
return nodeFn.call(fs.writeFile, flowsFullPath, JSON.stringify(flows));
|
|
||||||
|
var flowData;
|
||||||
|
|
||||||
|
if (settings.flowFilePretty) {
|
||||||
|
flowData = JSON.stringify(flows,null,4);
|
||||||
|
} else {
|
||||||
|
flowData = JSON.stringify(flows);
|
||||||
|
}
|
||||||
|
|
||||||
|
return nodeFn.call(fs.writeFile, flowsFullPath, flowData);
|
||||||
},
|
},
|
||||||
|
|
||||||
getCredentials: function() {
|
getCredentials: function() {
|
||||||
@ -207,7 +216,14 @@ var localfilesystem = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
saveCredentials: function(credentials) {
|
saveCredentials: function(credentials) {
|
||||||
return nodeFn.call(fs.writeFile, credentialsFile, JSON.stringify(credentials))
|
var credentialData;
|
||||||
|
if (settings.flowFilePretty) {
|
||||||
|
credentialData = JSON.stringify(credentials,null,4);
|
||||||
|
} else {
|
||||||
|
credentialData = JSON.stringify(credentials);
|
||||||
|
}
|
||||||
|
|
||||||
|
return nodeFn.call(fs.writeFile, credentialsFile, credentialData)
|
||||||
},
|
},
|
||||||
|
|
||||||
getAllFlows: function() {
|
getAllFlows: function() {
|
||||||
|
@ -41,6 +41,10 @@ module.exports = {
|
|||||||
// The file containing the flows. If not set, it defaults to flows_<hostname>.json
|
// The file containing the flows. If not set, it defaults to flows_<hostname>.json
|
||||||
//flowFile: 'flows.json',
|
//flowFile: 'flows.json',
|
||||||
|
|
||||||
|
// To enabled pretty-printing of the flow within the flow file, set the following
|
||||||
|
// property to true:
|
||||||
|
//flowFilePretty: true,
|
||||||
|
|
||||||
// By default, all user data is stored in the Node-RED install directory. To
|
// By default, all user data is stored in the Node-RED install directory. To
|
||||||
// use a different location, the following property can be used
|
// use a different location, the following property can be used
|
||||||
//userDir: '/home/nol/.node-red/',
|
//userDir: '/home/nol/.node-red/',
|
||||||
|
Loading…
Reference in New Issue
Block a user