@@ -26,6 +26,8 @@ const s3 = new AWS.S3({
2626} ) ;
2727const registry = config . registry . host
2828
29+ const containerFileList = 'biocontainers_' + Date . now ( ) + '.json'
30+
2931var docker_errors = 0 ;
3032var quay_errors = 0 ;
3133var last_login = 0 ;
@@ -477,7 +479,7 @@ async function dockerhub(containers, scan_options) {
477479 console . log ( '[docker]' , c ) ;
478480 if ( ! tags || tags . length == 0 ) {
479481 tags = await getDockerhubTags ( c , scan_options ) ;
480- await fs . writeFileSync ( `${ config . workdir } /biocontainers.json ` , JSON . stringify ( { name : c , tags : tags , type : 'docker' } ) + "\n" , { flag : 'a+' } ) ;
482+ await fs . writeFileSync ( `${ config . workdir } /${ containerFileList } ` , JSON . stringify ( { name : c , tags : tags , type : 'docker' } ) + "\n" , { flag : 'a+' } ) ;
481483 }
482484 } catch ( err ) {
483485 docker_errors ++ ;
@@ -508,7 +510,7 @@ async function quayio(containers, scan_options) {
508510 try {
509511 if ( ! tags || tags . length == 0 ) {
510512 tags = await getQuayioTags ( c , scan_options ) ;
511- await fs . writeFileSync ( `${ config . workdir } /biocontainers.json ` , JSON . stringify ( { name : c , tags : tags , type : 'bioconda' } ) + "\n" , { flag : 'a+' } ) ;
513+ await fs . writeFileSync ( `${ config . workdir } /${ containerFileList } ` , JSON . stringify ( { name : c , tags : tags , type : 'bioconda' } ) + "\n" , { flag : 'a+' } ) ;
512514 }
513515 } catch ( err ) {
514516 quay_errors ++ ;
@@ -610,11 +612,6 @@ if(fs.existsSync(`${config.workdir}/sync.lock`)) {
610612 fs . writeFileSync ( `${ config . workdir } /sync.lock` , '' )
611613}
612614
613- if ( fs . existsSync ( `${ config . workdir } /biocontainers.json` ) ) {
614- fs . unlinkSync ( `${ config . workdir } /biocontainers.json` ) ;
615- }
616-
617-
618615
619616getContainers ( options ) . then ( ( containers ) => {
620617 let ts = new Date ( )
@@ -641,6 +638,7 @@ getContainers(options).then((containers) => {
641638} ) . then ( ( ) => {
642639 console . log ( 'done' , total , docker_errors , quay_errors ) ;
643640 fs . unlinkSync ( `${ config . workdir } /sync.lock` ) ;
641+ fs . unlinkSync ( `${ config . workdir } /${ containerFileList } ` )
644642 process . exit ( 0 ) ;
645643} ) . catch ( err => {
646644 console . error ( 'oopps!' , err , docker_errors , quay_errors ) ;
0 commit comments