Skip to content

Commit ba21b46

Browse files
committed
fix(Hub): simple stream output feedback
close #13
1 parent 4348611 commit ba21b46

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/unityHub.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,16 @@ class UnityHub {
234234
throw new Error("No module IDs provided.");
235235
}
236236

237-
const { stdout, stderr } = await this.execUnityHubCommand(args, {
237+
const { stderr } = await this.execUnityHubCommand(args, {
238238
reject: false,
239+
onStderr: (data: string) => {
240+
console.warn(`Unity Hub stderr: ${data}`);
241+
},
242+
onStdout: (data: string) => {
243+
console.debug(`Unity Hub stdout: ${data}`);
244+
},
239245
});
240246

241-
console.debug(`Add module command output: ${stdout}`);
242-
243247
if (stderr) {
244248
console.warn(`Add module command warning/error: ${stderr}`);
245249
}
@@ -286,6 +290,12 @@ class UnityHub {
286290

287291
const { stdout, stderr } = await this.execUnityHubCommand(args, {
288292
reject: false,
293+
onStderr: (data: string) => {
294+
console.warn(`Unity Hub stderr: ${data}`);
295+
},
296+
onStdout: (data: string) => {
297+
console.debug(`Unity Hub stdout: ${data}`);
298+
},
289299
});
290300

291301
if (stderr) {

0 commit comments

Comments
 (0)