Skip to content

Commit 28437b9

Browse files
committed
fix(amplify-gen2-migration-e2e-system): pipe amplify push output unless debug
Only inherit stdio for amplify push when the logger is in debug mode. Otherwise pipe stdout/stderr to keep non-verbose runs quieter. Adds Logger.isDebug() helper. --- Prompt: I made another code change, commit and update the pr file.
1 parent 082ed61 commit 28437b9

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

packages/amplify-gen2-migration-e2e-system/src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ async function amplifyPush(targetAppPath: string): Promise<void> {
456456
try {
457457
const result = await execa(amplifyPath, ['push', '--yes', '--debug'], {
458458
cwd: targetAppPath,
459-
stdio: 'inherit',
459+
stdio: logger.isDebug() ? 'inherit' : 'pipe',
460460
});
461461

462462
if (result.exitCode !== 0) {

packages/amplify-gen2-migration-e2e-system/src/utils/logger.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export class Logger {
1616
this.logLevel = logLevel;
1717
}
1818

19+
public isDebug(): boolean {
20+
return this.logLevel === LogLevel.DEBUG;
21+
}
22+
1923
debug(message: string): void {
2024
this.log(LogLevel.DEBUG, message, undefined);
2125
}

0 commit comments

Comments
 (0)