mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
🔀 Merge branch 'master' of github.com:n8n-io/n8n
This commit is contained in:
commit
b74dee450f
|
@ -348,13 +348,11 @@ export class Ftp implements INodeType {
|
||||||
const remotePath = this.getNodeParameter('path', i) as string;
|
const remotePath = this.getNodeParameter('path', i) as string;
|
||||||
|
|
||||||
// Check if dir path exists
|
// 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 dir does not exist, create all recursively in path
|
||||||
if (!dirExists) {
|
if (!dirExists) {
|
||||||
// Separate filename from dir path
|
|
||||||
const fileName = basename(remotePath);
|
|
||||||
const dirPath = remotePath.replace(fileName, '');
|
|
||||||
// Create directory
|
// Create directory
|
||||||
await sftp!.mkdir(dirPath, true);
|
await sftp!.mkdir(dirPath, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue