Skip to content

Commit e52a96e

Browse files
committed
fix: ensure boxes don't wrap
* Limits the size of boxes to the terminal width. * Logs relative paths to the output directory, instead of absolute ones.
1 parent f338eb2 commit e52a96e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

runner/report-cli.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Arguments, Argv, CommandModule } from 'yargs';
2-
import { join } from 'path';
2+
import { join, relative } from 'path';
33
import { executeCommand } from './utils/exec.js';
44
import { REPORTS_ROOT_DIR } from './configuration/constants.js';
55
import { toProcessAbsolutePath } from './file-system-utils.js';
@@ -63,9 +63,8 @@ async function handler(cliArgs: Arguments<Options>): Promise<void> {
6363
formatTitleCard(
6464
[
6565
`View your reports at http://localhost:${cliArgs.port}`,
66-
`Reports are served from ${reportsDir}`,
67-
].join('\n'),
68-
120 // Use a wider box since file paths can be long.
66+
`Reports are served from ${relative(process.cwd(), reportsDir)}`,
67+
].join('\n')
6968
)
7069
);
7170

runner/reporting/format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function formatTitleCard(text: string, width = 80): string {
1414
borderStyle: 'double',
1515
borderColor: 'cyan',
1616
padding: 1,
17-
width,
17+
width: Math.min(width, process.stdout.columns),
1818
});
1919
}
2020

runner/reporting/report-logging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export function logReportToConsole(runInfo: RunInfo): void {
289289
boxen(summaryLines.join('\n'), {
290290
padding: 1,
291291
margin: { top: 2 },
292-
width: 80,
292+
width: Math.min(80, process.stdout.columns),
293293
borderColor: 'cyan',
294294
borderStyle: 'double',
295295
title: 'Assessment Summary',

0 commit comments

Comments
 (0)