Skip to content

Commit f3692f5

Browse files
author
Maxim Lobanov
committed
fix output
1 parent 01e147a commit f3692f5

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

dist/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,9 +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+
}
17001703
if (line === previousPrintedLine) {
17011704
return;
17021705
}
1706+
core.info("DEBUG");
1707+
core.info(previousPrintedLine);
1708+
core.info(line);
17031709
stdout += line;
17041710
if (printOutputInDebug) {
17051711
utils_1.splitByEOL(line).map(s => s.trim()).filter(Boolean).forEach(s => core.debug(s));
@@ -1715,8 +1721,8 @@ class SDKManager {
17151721
stderr: outputListener,
17161722
},
17171723
};
1718-
const commandString = `${this.sdkManagerPath.replace("\"", "")} ${args.join(" ")}`;
1719-
console.log(commandString);
1724+
const commandString = `${this.sdkManagerPath.replace(/\\"/g, " ")} ${args.join(" ")}`;
1725+
console.log(`[command]${commandString}`);
17201726
const exitCode = await exec.exec(this.sdkManagerPath, args, options);
17211727
if (exitCode !== 0) {
17221728
throw new Error(`'${commandString}' has finished with exit code '${exitCode}'`);

src/sdk-manager.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,17 @@ 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+
}
3437
if (line === previousPrintedLine) {
3538
return;
3639
}
3740

41+
core.info("DEBUG");
42+
core.info(previousPrintedLine);
43+
core.info(line);
44+
3845
stdout += line;
3946
if (printOutputInDebug) {
4047
splitByEOL(line).map(s => s.trim()).filter(Boolean).forEach(s => core.debug(s));
@@ -50,8 +57,8 @@ export class SDKManager {
5057
stderr: outputListener,
5158
},
5259
};
53-
const commandString = `${this.sdkManagerPath.replace("\"", "")} ${args.join(" ")}`;
54-
console.log(commandString);
60+
const commandString = `${this.sdkManagerPath.replace(/\\"/g, " ")} ${args.join(" ")}`;
61+
console.log(`[command]${commandString}`);
5562
const exitCode = await exec.exec(this.sdkManagerPath, args, options);
5663
if (exitCode !== 0) {
5764
throw new Error(`'${commandString}' has finished with exit code '${exitCode}'`);

0 commit comments

Comments
 (0)