@@ -3,6 +3,7 @@ const fs = require('fs');
3
3
const path = require ( 'path' ) ;
4
4
const tmp = require ( 'tmp' ) ;
5
5
const shelljs = require ( 'shelljs' ) ;
6
+ const IS_TRAVIS = ! ! process . env . TRAVIS ;
6
7
7
8
const yargs = require ( 'yargs' )
8
9
. option ( 'workspace' , {
@@ -12,6 +13,12 @@ const yargs = require('yargs')
12
13
13
14
const nodeCleanup = require ( 'node-cleanup' ) ;
14
15
const 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 ;
15
22
16
23
const util = require ( './util' ) ;
17
24
util . packageDir ( ) ;
@@ -164,6 +171,8 @@ function runDownstreamTests(key, upstreamPackages, downstreamTreeNode, successLo
164
171
165
172
const name = downstreamTreeNode . installDir ;
166
173
174
+ foldEnd = foldStart ( ` ===> Running downstream tests: '${ name } ' <===` )
175
+
167
176
console . log ( ` ===> '${ name } ': prepping tests <===` ) ;
168
177
process . chdir ( downstreamTreeNode . installDir ) ;
169
178
@@ -183,13 +192,16 @@ function runDownstreamTests(key, upstreamPackages, downstreamTreeNode, successLo
183
192
console . log ( ` ===> '${ name } ': Reverting working copy <===` ) ;
184
193
revertLocalChanges ( downstreamTreeNode . installSource ) ;
185
194
195
+ foldEnd ( ) ;
186
196
187
197
const downstreamChildren = Object . keys ( downstreamTreeNode . children || { } ) ;
188
198
if ( downstreamChildren . length ) {
189
199
const thisPkg = JSON . parse ( fs . readFileSync ( 'package.json' ) ) . name ;
190
200
const upstreams = upstreamPackages . concat ( thisPkg ) ;
191
201
202
+ foldEnd = foldStart ( ` ===> Local Yalc Publish: ${ process . cwd ( ) } <===` ) ;
192
203
localPublish ( process . cwd ( ) ) ;
204
+ foldEnd ( ) ;
193
205
194
206
downstreamChildren . forEach ( child => {
195
207
runDownstreamTests ( child , upstreams , downstreamTreeNode . children [ child ] , successLog ) ;
@@ -200,17 +212,20 @@ function runDownstreamTests(key, upstreamPackages, downstreamTreeNode, successLo
200
212
console . log ( ` ===> Creating .downstream_cache working directory <===` ) ;
201
213
makeDownstreamCache ( ) ;
202
214
203
- console . log ( ` ===> Publishing ${ pkgjson . name } to yalc registry <===` ) ;
215
+ foldEnd = foldStart ( ` ===> Publishing ${ pkgjson . name } to yalc registry <===` ) ;
204
216
localPublish ( ) ;
217
+ foldEnd ( ) ;
205
218
206
- console . log ( ` ===> Fetching downstream projects <===` ) ;
219
+ foldEnd = foldStart ( ` ===> Fetching downstream projects <===` ) ;
207
220
const tree = { children : { } } ;
208
221
fetchDownstreamProjects ( projects , "" , tree . children ) ;
222
+ foldEnd ( ) ;
209
223
210
224
if ( yargs . argv . workspace ) {
211
- console . log ( ` ===> Installing downstream dependencies <===` ) ;
225
+ foldEnd = foldStart ( ` ===> Installing downstream dependencies <===` ) ;
212
226
const downstreamDirs = getDownstreamInstallDirs ( tree ) ;
213
227
installWorkspaceDependencies ( downstreamDirs ) ;
228
+ foldEnd ( ) ;
214
229
}
215
230
216
231
console . log ( ` ===> Moving working directory to temp dir ${ TEMP_DIR } <===` ) ;
0 commit comments