🔀 Merge branch 'master' of github.com:n8n-io/n8n

This commit is contained in:
Jan Oberhauser 2020-11-16 18:22:12 +01:00
commit b74dee450f

View file

@ -348,13 +348,11 @@ export class Ftp implements INodeType {
const remotePath = this.getNodeParameter('path', i) as string;
// Check if dir path exists
const dirExists = await sftp!.exists(dirname(remotePath));
const dirPath = dirname(remotePath);
const dirExists = await sftp!.exists(dirPath);
// If dir does not exist, create all recursively in path
if (!dirExists) {
// Separate filename from dir path
const fileName = basename(remotePath);
const dirPath = remotePath.replace(fileName, '');
// Create directory
await sftp!.mkdir(dirPath, true);
}