()
| 156 | } |
| 157 | |
| 158 | function macOsProductVersion(): string | undefined { |
| 159 | try { |
| 160 | const version = execFileSync('/usr/bin/sw_vers', ['-productVersion'], { |
| 161 | encoding: 'utf-8', |
| 162 | timeout: 1000, |
| 163 | }).trim(); |
| 164 | return version.length > 0 ? version : undefined; |
| 165 | } catch { |
| 166 | return undefined; |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | function asciiHeader(value: string, fallback = 'unknown'): string { |
| 171 | const cleaned = value.replaceAll(/[^\u0020-\u007E]/g, '').trim(); |