Skip to content

Commit

Permalink
(simatec) Copypath check added
Browse files Browse the repository at this point in the history
  • Loading branch information
simatec committed Dec 10, 2023
1 parent c654ca5 commit d001f27
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ When the adapter crashes or another Code error happens, this error message that
### **WORK IN PROGRESS**
* (simatec) Gotify Notication added
* (simatec) dependencies updated
* (simatec) Copypath check added

### 2.9.5 (2023-11-29)
* (simatec) dependencies updated
Expand Down
37 changes: 19 additions & 18 deletions lib/scripts/60-cifs.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,29 @@ function command(options, log, callback) {
}
log.debug(`used copy path: ${dir}`);

//if (fs.existsSync(options.dir)) {
//copyFiles(options.dir, fileNames, log, options.context.errors, err => {
if (fs.existsSync(dir)) {
copyFiles(dir, fileNames, log, options.context.errors, err => {
if (err) {
log.error(err);
options.context.errors.cifs = options.context.errors.cifs || err;
}
if (options.deleteOldBackup === true) {
if (cleanFiles(dir, options, options.context.types, options.deleteBackupAfter, log, options.context.errors)) {
if (dir == options.backupDir) {
callback && callback(`The storage path "${dir}" for copying is not configured correctly`);
} else {
copyFiles(dir, fileNames, log, options.context.errors, err => {
if (err) {
log.error(err);
options.context.errors.cifs = options.context.errors.cifs || err;
}
if (options.deleteOldBackup === true) {
if (cleanFiles(dir, options, options.context.types, options.deleteBackupAfter, log, options.context.errors)) {
!options.context.errors.cifs && options.context.done.push('cifs');
}
} else {
!options.context.errors.cifs && options.context.done.push('cifs');
}
} else {
!options.context.errors.cifs && options.context.done.push('cifs');
}
if (callback) {
callback(err);
callback = null;
}
});
if (callback) {
callback(err);
callback = null;
}
});
}
} else if (options.mountType === 'Copy') {
//callback(`Path "${options.dir}" not found`);
callback && callback(`Path "${dir}" not found`);
} else {
callback && callback();
Expand Down

0 comments on commit d001f27

Please sign in to comment.