@@ -5,6 +5,7 @@ const errorTemplate = require('./error')
5
5
const Glob = require ( './glob' )
6
6
const NopCommand = require ( './nopcommand' )
7
7
const MergeDeep = require ( './mergeDeep' )
8
+ const Archive = require ( './plugins/archive' )
8
9
const env = require ( './env' )
9
10
const CONFIG_PATH = env . CONFIG_PATH
10
11
const eta = new Eta ( { views : path . join ( __dirname ) } )
@@ -326,38 +327,42 @@ ${this.results.reduce((x, y) => {
326
327
if ( overrideRepoConfig ) {
327
328
repoConfig = this . mergeDeep . mergeDeep ( { } , repoConfig , overrideRepoConfig )
328
329
}
329
- if ( repoConfig ) {
330
- try {
331
- this . log . debug ( `found a matching repoconfig for this repo ${ JSON . stringify ( repoConfig ) } ` )
332
- const childPlugins = this . childPluginsList ( repo )
333
- const RepoPlugin = Settings . PLUGINS . repository
334
- return new RepoPlugin ( this . nop , this . github , repo , repoConfig , this . installation_id , this . log , this . errors ) . sync ( ) . then ( res => {
335
- this . appendToResults ( res )
336
- return Promise . all (
337
- childPlugins . map ( ( [ Plugin , config ] ) => {
338
- return new Plugin ( this . nop , this . github , repo , config , this . log , this . errors ) . sync ( )
339
- } ) )
340
- } ) . then ( res => {
341
- this . appendToResults ( res )
342
- } )
343
- } catch ( e ) {
344
- if ( this . nop ) {
345
- const nopcommand = new NopCommand ( this . constructor . name , this . repo , null , `${ e } ` , 'ERROR' )
346
- this . log . error ( `NOPCOMMAND ${ JSON . stringify ( nopcommand ) } ` )
347
- this . appendToResults ( [ nopcommand ] )
348
- // throw e
349
- } else {
350
- throw e
330
+ const { shouldContinue, nopCommands} = await new Archive ( this . nop , this . github , repo , repoConfig , this . log ) . sync ( )
331
+ if ( nopCommands ) this . appendToResults ( nopCommands )
332
+ if ( shouldContinue ) {
333
+ if ( repoConfig ) {
334
+ try {
335
+ this . log . debug ( `found a matching repoconfig for this repo ${ JSON . stringify ( repoConfig ) } ` )
336
+ const childPlugins = this . childPluginsList ( repo )
337
+ const RepoPlugin = Settings . PLUGINS . repository
338
+ return new RepoPlugin ( this . nop , this . github , repo , repoConfig , this . installation_id , this . log , this . errors ) . sync ( ) . then ( res => {
339
+ this . appendToResults ( res )
340
+ return Promise . all (
341
+ childPlugins . map ( ( [ Plugin , config ] ) => {
342
+ return new Plugin ( this . nop , this . github , repo , config , this . log , this . errors ) . sync ( )
343
+ } ) )
344
+ } ) . then ( res => {
345
+ this . appendToResults ( res )
346
+ } )
347
+ } catch ( e ) {
348
+ if ( this . nop ) {
349
+ const nopcommand = new NopCommand ( this . constructor . name , this . repo , null , `${ e } ` , 'ERROR' )
350
+ this . log . error ( `NOPCOMMAND ${ JSON . stringify ( nopcommand ) } ` )
351
+ this . appendToResults ( [ nopcommand ] )
352
+ // throw e
353
+ } else {
354
+ throw e
355
+ }
351
356
}
357
+ } else {
358
+ this . log . debug ( `Didnt find any a matching repoconfig for this repo ${ JSON . stringify ( repo ) } in ${ JSON . stringify ( this . repoConfigs ) } ` )
359
+ const childPlugins = this . childPluginsList ( repo )
360
+ return Promise . all ( childPlugins . map ( ( [ Plugin , config ] ) => {
361
+ return new Plugin ( this . nop , this . github , repo , config , this . log , this . errors ) . sync ( ) . then ( res => {
362
+ this . appendToResults ( res )
363
+ } )
364
+ } ) )
352
365
}
353
- } else {
354
- this . log . debug ( `Didnt find any a matching repoconfig for this repo ${ JSON . stringify ( repo ) } in ${ JSON . stringify ( this . repoConfigs ) } ` )
355
- const childPlugins = this . childPluginsList ( repo )
356
- return Promise . all ( childPlugins . map ( ( [ Plugin , config ] ) => {
357
- return new Plugin ( this . nop , this . github , repo , config , this . log , this . errors ) . sync ( ) . then ( res => {
358
- this . appendToResults ( res )
359
- } )
360
- } ) )
361
366
}
362
367
}
363
368
0 commit comments