()
| 117 | } |
| 118 | |
| 119 | function printVersion() { |
| 120 | try { |
| 121 | const pkg = JSON.parse( |
| 122 | readFileSync(path.resolve(__dirname, '../package.json'), 'utf-8'), |
| 123 | ); |
| 124 | console.log(pkg.version); |
| 125 | } catch { |
| 126 | console.log('unknown'); |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | function getCommandOutput(error: unknown, key: 'stdout' | 'stderr'): string { |
| 131 | const output = (error as Partial<SpawnSyncReturns<Buffer>> | null)?.[key]; |