mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Check file exists before trying to take backup
This commit is contained in:
parent
4dd619b8c6
commit
ef67b8481e
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user