(lines: string[], borderColor: string)
| 30 | } |
| 31 | |
| 32 | function printBox(lines: string[], borderColor: string) { |
| 33 | const maxLen = Math.max(...lines.map((l) => getDisplayWidth(l))); |
| 34 | const width = maxLen + 4; |
| 35 | const border = '─'.repeat(width - 2); |
| 36 | |
| 37 | console.log(`${borderColor}┌${border}┐${colors.reset}`); |
| 38 | for (const line of lines) { |
| 39 | const displayLen = getDisplayWidth(line); |
| 40 | const padding = ' '.repeat(maxLen - displayLen); |
| 41 | console.log(`${borderColor}│${colors.reset} ${line}${padding} ${borderColor}│${colors.reset}`); |
| 42 | } |
| 43 | console.log(`${borderColor}└${border}┘${colors.reset}`); |
| 44 | } |
| 45 | |
| 46 | async function main() { |
| 47 | if (isVersionCheckDisabled(process.env)) { |
no test coverage detected