mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
⚡ Add continueOnFail support to SSH Node
This commit is contained in:
@@ -328,7 +328,7 @@ export class Ssh implements INodeType {
|
||||
}
|
||||
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
|
||||
try {
|
||||
if (resource === 'command') {
|
||||
|
||||
if (operation === 'execute') {
|
||||
@@ -346,7 +346,7 @@ export class Ssh implements INodeType {
|
||||
const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i) as string;
|
||||
const parameterPath = this.getNodeParameter('path', i) as string;
|
||||
|
||||
const { path } = await file({mode: 0x0777, prefix: 'prefix-'});
|
||||
const { path } = await file({ mode: 0x0777, prefix: 'prefix-' });
|
||||
temporaryFiles.push(path);
|
||||
|
||||
await ssh.getFile(path, parameterPath);
|
||||
@@ -393,11 +393,28 @@ export class Ssh implements INodeType {
|
||||
temporaryFiles.push(path);
|
||||
await writeFile(path, Buffer.from(binaryData.data, BINARY_ENCODING));
|
||||
|
||||
await ssh.putFile(path, `${parameterPath}${(parameterPath.charAt(parameterPath.length -1) === '/') ? '' : '/'}${fileName || binaryData.fileName}`);
|
||||
await ssh.putFile(path, `${parameterPath}${(parameterPath.charAt(parameterPath.length - 1) === '/') ? '' : '/'}${fileName || binaryData.fileName}`);
|
||||
|
||||
returnData.push({ success: true });
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('error', error);
|
||||
if (this.continueOnFail()) {
|
||||
console.log('k1');
|
||||
if (resource === 'file' && operation === 'download') {
|
||||
items[i] = {
|
||||
json: {
|
||||
error: error.message,
|
||||
}
|
||||
};
|
||||
} else {
|
||||
returnData.push({ error: error.message });
|
||||
}
|
||||
continue;
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
ssh.dispose();
|
||||
|
||||
Reference in New Issue
Block a user