@@ -3,6 +3,7 @@ const fs = require('fs');
33const path = require ( 'path' ) ;
44const tmp = require ( 'tmp' ) ;
55const shelljs = require ( 'shelljs' ) ;
6+ const IS_TRAVIS = ! ! process . env . TRAVIS ;
67
78const yargs = require ( 'yargs' )
89 . option ( 'workspace' , {
@@ -12,6 +13,12 @@ const yargs = require('yargs')
1213
1314const nodeCleanup = require ( 'node-cleanup' ) ;
1415const publishYalcPackage = require ( './publish_yalc_package' ) ;
16+ const foldStart = ( message ) => {
17+ IS_TRAVIS && console . log ( 'travis_fold:start:' + message ) ;
18+ console . log ( message ) ;
19+ return ( ) => IS_TRAVIS && console . log ( 'travis_fold:end:' + message ) ;
20+ } ;
21+ let foldEnd = ( ) => null ;
1522
1623const util = require ( './util' ) ;
1724util . packageDir ( ) ;
@@ -164,6 +171,8 @@ function runDownstreamTests(key, upstreamPackages, downstreamTreeNode, successLo
164171
165172 const name = downstreamTreeNode . installDir ;
166173
174+ foldEnd = foldStart ( ` ===> Running downstream tests: '${ name } ' <===` )
175+
167176 console . log ( ` ===> '${ name } ': prepping tests <===` ) ;
168177 process . chdir ( downstreamTreeNode . installDir ) ;
169178
@@ -183,13 +192,16 @@ function runDownstreamTests(key, upstreamPackages, downstreamTreeNode, successLo
183192 console . log ( ` ===> '${ name } ': Reverting working copy <===` ) ;
184193 revertLocalChanges ( downstreamTreeNode . installSource ) ;
185194
195+ foldEnd ( ) ;
186196
187197 const downstreamChildren = Object . keys ( downstreamTreeNode . children || { } ) ;
188198 if ( downstreamChildren . length ) {
189199 const thisPkg = JSON . parse ( fs . readFileSync ( 'package.json' ) ) . name ;
190200 const upstreams = upstreamPackages . concat ( thisPkg ) ;
191201
202+ foldEnd = foldStart ( ` ===> Local Yalc Publish: ${ process . cwd ( ) } <===` ) ;
192203 localPublish ( process . cwd ( ) ) ;
204+ foldEnd ( ) ;
193205
194206 downstreamChildren . forEach ( child => {
195207 runDownstreamTests ( child , upstreams , downstreamTreeNode . children [ child ] , successLog ) ;
@@ -200,17 +212,20 @@ function runDownstreamTests(key, upstreamPackages, downstreamTreeNode, successLo
200212console . log ( ` ===> Creating .downstream_cache working directory <===` ) ;
201213makeDownstreamCache ( ) ;
202214
203- console . log ( ` ===> Publishing ${ pkgjson . name } to yalc registry <===` ) ;
215+ foldEnd = foldStart ( ` ===> Publishing ${ pkgjson . name } to yalc registry <===` ) ;
204216localPublish ( ) ;
217+ foldEnd ( ) ;
205218
206- console . log ( ` ===> Fetching downstream projects <===` ) ;
219+ foldEnd = foldStart ( ` ===> Fetching downstream projects <===` ) ;
207220const tree = { children : { } } ;
208221fetchDownstreamProjects ( projects , "" , tree . children ) ;
222+ foldEnd ( ) ;
209223
210224if ( yargs . argv . workspace ) {
211- console . log ( ` ===> Installing downstream dependencies <===` ) ;
225+ foldEnd = foldStart ( ` ===> Installing downstream dependencies <===` ) ;
212226 const downstreamDirs = getDownstreamInstallDirs ( tree ) ;
213227 installWorkspaceDependencies ( downstreamDirs ) ;
228+ foldEnd ( ) ;
214229}
215230
216231console . log ( ` ===> Moving working directory to temp dir ${ TEMP_DIR } <===` ) ;
0 commit comments