@@ -15,7 +15,8 @@ let specSummary = {
15
15
}
16
16
let noWrap = false ;
17
17
let terminalWidth = ( process . stdout . columns ) * 0.9 ;
18
- let lineSeparator = "\n" + "-" . repeat ( terminalWidth ) ;
18
+ let lineSeparator = Constants . syncCLI . DEFAULT_LINE_SEP ;
19
+ if ( ! isNaN ( terminalWidth ) ) lineSeparator = "\n" + "-" . repeat ( terminalWidth ) ;
19
20
20
21
let getOptions = ( auth , build_id ) => {
21
22
return {
@@ -32,13 +33,13 @@ let getOptions = (auth, build_id) => {
32
33
} ;
33
34
}
34
35
35
- let getTableConfig = ( ) => {
36
- let centerWidth = Math . ceil ( terminalWidth * 0.01 ) ,
37
- leftWidth = Math . floor ( terminalWidth * 0.75 ) ,
38
- colWidth = Math . floor ( terminalWidth * 0.2 ) ;
36
+ let getTableConfig = ( termWidth ) => {
37
+ let centerWidth = Math . ceil ( termWidth * 0.01 ) ,
38
+ leftWidth = Math . floor ( termWidth * 0.75 ) ,
39
+ colWidth = Math . floor ( termWidth * 0.2 ) ;
39
40
40
41
// Do not autosize on terminal's width if no-wrap provided
41
- if ( noWrap ) {
42
+ if ( noWrap || isNaN ( termWidth ) ) {
42
43
centerWidth = 1 ;
43
44
leftWidth = 100 ;
44
45
colWidth = 30 ;
@@ -84,15 +85,15 @@ let setNoWrapParams = () => {
84
85
noWrap = ( process . env . SYNC_NO_WRAP && ( process . env . SYNC_NO_WRAP === 'true' ) ) ;
85
86
// Do not show the separator based on terminal width if no-wrap provided.
86
87
if ( noWrap ) {
87
- lineSeparator = "\n--------------------------------------------------------------------------------" ;
88
+ lineSeparator = Constants . syncCLI . DEFAULT_LINE_SEP ;
88
89
}
89
90
} ;
90
91
91
92
let printSpecsStatus = ( bsConfig , buildDetails ) => {
92
93
setNoWrapParams ( ) ;
93
94
return new Promise ( ( resolve , reject ) => {
94
95
options = getOptions ( bsConfig . auth , buildDetails . build_id )
95
- tableConfig = getTableConfig ( ) ;
96
+ tableConfig = getTableConfig ( terminalWidth ) ;
96
97
stream = tableStream ( tableConfig ) ;
97
98
98
99
async . whilst (
0 commit comments