| 553 | } |
| 554 | |
| 555 | function isTTY(): boolean { |
| 556 | const isTruthy = (value: undefined | string) => { |
| 557 | // Returns true if value is a string that is anything but 0 or false. |
| 558 | return value !== undefined && value !== '0' && value.toUpperCase() !== 'FALSE'; |
| 559 | }; |
| 560 | |
| 561 | // If we force TTY, we always return true. |
| 562 | const force = process.env['NG_FORCE_TTY']; |
| 563 | if (force !== undefined) { |
| 564 | return isTruthy(force); |
| 565 | } |
| 566 | |
| 567 | return !!process.stdout.isTTY && !isTruthy(process.env['CI']); |
| 568 | } |
| 569 | |
| 570 | if (require.main === module) { |
| 571 | const args = process.argv.slice(2); |