From d1318d215cddbc39438548f23bb8aeeaed384ba8 Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Tue, 6 May 2014 16:02:18 +0100 Subject: [PATCH] change preferred name of backup file to flows.backup (even if it is the previous version :-) relates to Issue #184 --- .gitignore | 2 +- red/storage/localfilesystem.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index b23124927..e435d0734 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ node_modules credentials.json flows*.json -flow.backup +flows.backup *_cred* nodes/node-red-nodes/ .npm diff --git a/red/storage/localfilesystem.js b/red/storage/localfilesystem.js index 5dc191768..4288c7147 100644 --- a/red/storage/localfilesystem.js +++ b/red/storage/localfilesystem.js @@ -153,7 +153,7 @@ var localfilesystem = { var fsext = fspath.extname(flowsFile); credentialsFile = fspath.join(userDir,fspath.basename(flowsFile,fsext)+"_cred"+fsext); oldCredentialsFile = fspath.join(userDir,"credentials.json"); - flowsPrev = fspath.join(userDir,"flow.backup"); + flowsPrev = fspath.join(userDir,"flows.backup"); libDir = fspath.join(userDir,"lib"); libFlowsDir = fspath.join(libDir,"flows"); @@ -178,7 +178,7 @@ var localfilesystem = { }, saveFlows: function(flows) { - fs.rename(flowsFullPath,flowsPrev); + fs.renameSync(flowsFullPath,flowsPrev); return nodeFn.call(fs.writeFile, flowsFullPath, JSON.stringify(flows)); },