Skip to content

Commit

Permalink
Fix RUN component new-line character issue
Browse files Browse the repository at this point in the history
Fix CSV_LOOKUP skip output issue
  • Loading branch information
fttx committed Sep 3, 2020
1 parent 0746215 commit 917d376
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions electron/src/handlers/scans.handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export class ScansHandler implements Handler {

// keyboard emulation
for (let outputBlock of scan.outputBlocks) {
if (outputBlock.skipOutput && outputBlock.type != 'http' && outputBlock.type != 'run') {
if (outputBlock.skipOutput && outputBlock.type != 'http' && outputBlock.type != 'run'
&& outputBlock.type != 'csv_lookup' && outputBlock.type != 'focus_window') {
// for these components the continue; is called inside the switch below (< v3.12.0)
continue;
}

Expand Down Expand Up @@ -276,7 +278,7 @@ export class ScansHandler implements Handler {

case 'run': {
try {
responseOutputBlock.value = execSync(request.outputBlock.value, { cwd: os.homedir(), timeout: 10000, maxBuffer: 1024 }).toString();
responseOutputBlock.value = execSync(request.outputBlock.value, { cwd: os.homedir(), timeout: 10000, maxBuffer: 1024 }).toString().slice(0, -1);
} catch (error) {
responseOutputBlock.value = "";
let output = error.output.toString().substr(2);
Expand Down Expand Up @@ -325,7 +327,7 @@ export class ScansHandler implements Handler {
ws.send(JSON.stringify(remoteComponentResponse));
break;
} // end ACTION_REMOTE_COMPONENT
}
} // end switch(message.action)
return message;
}

Expand Down

0 comments on commit 917d376

Please sign in to comment.