@@ -15,7 +15,8 @@ let specSummary = {
1515}
1616let noWrap = false ;
1717let 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 ) ;
1920
2021let getOptions = ( auth , build_id ) => {
2122 return {
@@ -32,13 +33,13 @@ let getOptions = (auth, build_id) => {
3233 } ;
3334}
3435
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 ) ;
3940
4041 // Do not autosize on terminal's width if no-wrap provided
41- if ( noWrap ) {
42+ if ( noWrap || isNaN ( termWidth ) ) {
4243 centerWidth = 1 ;
4344 leftWidth = 100 ;
4445 colWidth = 30 ;
@@ -84,15 +85,15 @@ let setNoWrapParams = () => {
8485 noWrap = ( process . env . SYNC_NO_WRAP && ( process . env . SYNC_NO_WRAP === 'true' ) ) ;
8586 // Do not show the separator based on terminal width if no-wrap provided.
8687 if ( noWrap ) {
87- lineSeparator = "\n--------------------------------------------------------------------------------" ;
88+ lineSeparator = Constants . syncCLI . DEFAULT_LINE_SEP ;
8889 }
8990} ;
9091
9192let printSpecsStatus = ( bsConfig , buildDetails ) => {
9293 setNoWrapParams ( ) ;
9394 return new Promise ( ( resolve , reject ) => {
9495 options = getOptions ( bsConfig . auth , buildDetails . build_id )
95- tableConfig = getTableConfig ( ) ;
96+ tableConfig = getTableConfig ( terminalWidth ) ;
9697 stream = tableStream ( tableConfig ) ;
9798
9899 async . whilst (
0 commit comments