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 5
5
* Use of this source code is governed by an MIT-style license that can be
6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
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
+
8
14
export function isTTY ( ) : boolean {
15
+ // If we force TTY, we always return true.
9
16
const force = process . env [ 'NG_FORCE_TTY' ] ;
10
17
if ( force !== undefined ) {
11
- return ! ( force === '0' || force . toUpperCase ( ) === 'FALSE' ) ;
18
+ return _isTruthy ( force ) ;
12
19
}
13
20
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' ] ) ;
17
22
}
You can’t perform that action at this time.
0 commit comments