Skip to content

Commit

Permalink
do not create dir if root path on smb
Browse files Browse the repository at this point in the history
  • Loading branch information
vdiez committed Sep 17, 2021
1 parent c613fde commit 644e402
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion protocols/ftp.js
Expand Up @@ -127,8 +127,8 @@ module.exports = class extends base {
})), true);
}
mkdir(dir) {
if (dir === "." || dir === "/" || dir === "") return;
return this.wrapper((connection, slot) => new Promise((resolve, reject) => {
if (dir === "." || dir === "/" || dir === "") resolve();
this.logger.debug("FTP (slot " + slot + ") mkdir: ", dir);
connection.mkdir(dir, true, err => {
if (err) reject(err);
Expand Down
1 change: 1 addition & 0 deletions protocols/smb.js
Expand Up @@ -63,6 +63,7 @@ module.exports = class extends base {
}), true);
}
mkdir(dir) {
if (!dir || dir === "/" || dir === ".") return;
return this.wrapper((connection, slot) => new Promise((resolve, reject) => {
this.logger.debug("SMB (slot " + slot + ") mkdir: ", dir);
connection.mkdir(dir.replace(/\//g, "\\"), err => {
Expand Down

0 comments on commit 644e402

Please sign in to comment.