Skip to content

Commit

Permalink
Change trimming to direct writing to process stdout
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanduplenskikh committed Oct 4, 2024
1 parent 437a985 commit 72a627f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Tasks/SshV0/ssh2helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export function runCommandOnRemoteMachine(
}).on('data', (data) => {
if (data) {
// "data" can be a buffer. Format it here so it outputs as a string
if (tl.getPipelineFeature("trimSshTaskOutput")) {
console.log(data.toString('utf8').trim());
if (tl.getPipelineFeature("redirectTaskOutputToProcessStdout")) {
process.stdout.write(data);
} else {
console.log(data.toString('utf8'));
}
Expand Down Expand Up @@ -178,8 +178,8 @@ export function runCommandOnRemoteMachine(
}).on('data', (data) => {
if (data) {
// "data" can be a buffer. Format it here so it outputs as a string
if (tl.getPipelineFeature("trimSshTaskOutput")) {
console.log(data.toString('utf8').trim());
if (tl.getPipelineFeature("redirectTaskOutputToProcessStdout")) {
process.stdout.write(data);
} else {
console.log(data.toString('utf8'));
}
Expand Down
8 changes: 4 additions & 4 deletions _generated/SshV0/ssh2helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export function runCommandOnRemoteMachine(
}).on('data', (data) => {
if (data) {
// "data" can be a buffer. Format it here so it outputs as a string
if (tl.getPipelineFeature("trimSshTaskOutput")) {
console.log(data.toString('utf8').trim());
if (tl.getPipelineFeature("redirectTaskOutputToProcessStdout")) {
process.stdout.write(data);
} else {
console.log(data.toString('utf8'));
}
Expand Down Expand Up @@ -178,8 +178,8 @@ export function runCommandOnRemoteMachine(
}).on('data', (data) => {
if (data) {
// "data" can be a buffer. Format it here so it outputs as a string
if (tl.getPipelineFeature("trimSshTaskOutput")) {
console.log(data.toString('utf8').trim());
if (tl.getPipelineFeature("redirectTaskOutputToProcessStdout")) {
process.stdout.write(data);
} else {
console.log(data.toString('utf8'));
}
Expand Down
8 changes: 4 additions & 4 deletions _generated/SshV0_Node20/ssh2helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export function runCommandOnRemoteMachine(
}).on('data', (data) => {
if (data) {
// "data" can be a buffer. Format it here so it outputs as a string
if (tl.getPipelineFeature("trimSshTaskOutput")) {
console.log(data.toString('utf8').trim());
if (tl.getPipelineFeature("redirectTaskOutputToProcessStdout")) {
process.stdout.write(data);
} else {
console.log(data.toString('utf8'));
}
Expand Down Expand Up @@ -178,8 +178,8 @@ export function runCommandOnRemoteMachine(
}).on('data', (data) => {
if (data) {
// "data" can be a buffer. Format it here so it outputs as a string
if (tl.getPipelineFeature("trimSshTaskOutput")) {
console.log(data.toString('utf8').trim());
if (tl.getPipelineFeature("redirectTaskOutputToProcessStdout")) {
process.stdout.write(data);
} else {
console.log(data.toString('utf8'));
}
Expand Down

0 comments on commit 72a627f

Please sign in to comment.