mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Check file exists before trying to take backup
This commit is contained in:
@@ -80,7 +80,7 @@ module.exports = {
|
||||
*/
|
||||
writeFile: function(path,content,backupPath) {
|
||||
var backupPromise;
|
||||
if (backupPath) {
|
||||
if (backupPath && fs.existsSync(path)) {
|
||||
backupPromise = fs.copy(path,backupPath);
|
||||
} else {
|
||||
backupPromise = Promise.resolve();
|
||||
|
Reference in New Issue
Block a user