Skip to content

Commit 11cd676

Browse files
author
Maxim Lobanov
committed
debug
1 parent f3692f5 commit 11cd676

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

dist/index.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,20 +1697,15 @@ class SDKManager {
16971697
let previousPrintedLine = "";
16981698
const outputListener = (data) => {
16991699
const line = data.toString();
1700-
if (line.trim().length === 0) {
1701-
return;
1702-
}
1703-
if (line === previousPrintedLine) {
1704-
return;
1705-
}
1706-
core.info("DEBUG");
1707-
core.info(previousPrintedLine);
1708-
core.info(line);
17091700
stdout += line;
17101701
if (printOutputInDebug) {
1711-
utils_1.splitByEOL(line).map(s => s.trim()).filter(Boolean).forEach(s => core.debug(s));
1702+
utils_1.splitByEOL(line).map(s => s.trim()).filter(Boolean).forEach(s => {
1703+
if (previousPrintedLine !== s) {
1704+
core.debug(s);
1705+
previousPrintedLine = s;
1706+
}
1707+
});
17121708
}
1713-
previousPrintedLine = line;
17141709
};
17151710
const options = {
17161711
silent: true,
@@ -1721,7 +1716,7 @@ class SDKManager {
17211716
stderr: outputListener,
17221717
},
17231718
};
1724-
const commandString = `${this.sdkManagerPath.replace(/\\"/g, " ")} ${args.join(" ")}`;
1719+
const commandString = `${this.sdkManagerPath.replace(/"/g, " ")} ${args.join(" ")}`;
17251720
console.log(`[command]${commandString}`);
17261721
const exitCode = await exec.exec(this.sdkManagerPath, args, options);
17271722
if (exitCode !== 0) {

src/sdk-manager.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,16 @@ export class SDKManager {
3131
let previousPrintedLine = "";
3232
const outputListener = (data: Buffer): void => {
3333
const line = data.toString();
34-
if (line.trim().length === 0) {
35-
return;
36-
}
37-
if (line === previousPrintedLine) {
38-
return;
39-
}
40-
41-
core.info("DEBUG");
42-
core.info(previousPrintedLine);
43-
core.info(line);
44-
4534
stdout += line;
35+
4636
if (printOutputInDebug) {
47-
splitByEOL(line).map(s => s.trim()).filter(Boolean).forEach(s => core.debug(s));
37+
splitByEOL(line).map(s => s.trim()).filter(Boolean).forEach(s => {
38+
if (previousPrintedLine !== s) {
39+
core.debug(s);
40+
previousPrintedLine = s;
41+
}
42+
});
4843
}
49-
previousPrintedLine = line;
5044
};
5145
const options: exec.ExecOptions = {
5246
silent: true,
@@ -57,7 +51,7 @@ export class SDKManager {
5751
stderr: outputListener,
5852
},
5953
};
60-
const commandString = `${this.sdkManagerPath.replace(/\\"/g, " ")} ${args.join(" ")}`;
54+
const commandString = `${this.sdkManagerPath.replace(/"/g, " ")} ${args.join(" ")}`;
6155
console.log(`[command]${commandString}`);
6256
const exitCode = await exec.exec(this.sdkManagerPath, args, options);
6357
if (exitCode !== 0) {

0 commit comments

Comments
 (0)