File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
packages/angular/cli/utilities Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 55 * Use of this source code is governed by an MIT-style license that can be
66 * found in the LICENSE file at https://angular.io/license
77 */
8+
9+ function _isTruthy ( value : undefined | string ) : boolean {
10+ // Returns true if value is a string that is anything but 0 or false.
11+ return value !== undefined && value !== '0' && value . toUpperCase ( ) !== 'FALSE' ;
12+ }
13+
814export function isTTY ( ) : boolean {
15+ // If we force TTY, we always return true.
916 const force = process . env [ 'NG_FORCE_TTY' ] ;
1017 if ( force !== undefined ) {
11- return ! ( force === '0' || force . toUpperCase ( ) === 'FALSE' ) ;
18+ return _isTruthy ( force ) ;
1219 }
1320
14- const ci = process . env [ 'CI' ] ;
15-
16- return ! ! process . stdout . isTTY && ( ! ci || ci === '0' || ci . toUpperCase ( ) === 'FALSE' ) ;
21+ return ! ! process . stdout . isTTY && ! _isTruthy ( process . env [ 'CI' ] ) ;
1722}
You can’t perform that action at this time.
0 commit comments