@@ -1528,6 +1528,55 @@ function analyzeChangesFromLastRelease (cb) {
15281528 } )
15291529}
15301530
1531+ function assembleAndZipInputData ( callback ) {
1532+ // since lots of files are at absolute paths, assemble a temporary folder with needed files
1533+ const tempInputFilesDir = path . join ( workingDir , 'input-data' )
1534+ asynclib . series (
1535+ [
1536+ // remove previous folder
1537+ cb => fs . rm ( tempInputFilesDir , { recursive : true } , cb ) ,
1538+ // create it again
1539+ cb => fs . mkdir ( tempInputFilesDir , cb ) ,
1540+ // copy necessary files
1541+ copyCb => {
1542+ asynclib . parallel (
1543+ [
1544+ // downloads
1545+ cb => fs . cp (
1546+ downloadsDir ,
1547+ path . join ( tempInputFilesDir , 'downloads' ) ,
1548+ { recursive : true } ,
1549+ cb
1550+ ) ,
1551+ // cache
1552+ cb => fs . cp (
1553+ cacheDir ,
1554+ path . join ( tempInputFilesDir , 'cache' ) ,
1555+ { recursive : true } ,
1556+ cb
1557+ ) ,
1558+ // etc single files (assumes cwd is repo root)
1559+ cb => fs . cp ( 'timezones.json' , path . join ( tempInputFilesDir , 'timezones.json' ) , cb ) ,
1560+ cb => fs . cp ( 'osmBoundarySources.json' , path . join ( tempInputFilesDir , 'osmBoundarySources.json' ) , cb ) ,
1561+ cb => fs . cp ( 'expectedZoneOverlaps.json' , path . join ( tempInputFilesDir , 'expectedZoneOverlaps.json' ) , cb )
1562+ ] ,
1563+ copyCb
1564+ )
1565+ } ,
1566+ // zip up
1567+ cb => {
1568+ const zipFilepath = path . join ( distDir , 'input-data.zip' )
1569+ exec (
1570+ `zip -r ${ zipFilepath } input-data` ,
1571+ { cwd : workingDir } ,
1572+ cb
1573+ )
1574+ }
1575+ ] ,
1576+ callback
1577+ )
1578+ }
1579+
15311580const autoScript = {
15321581 makeCacheDirAndFns : function ( cb ) {
15331582 overallProgress . beginTask ( `Creating downloads dir (${ downloadsDir } )` )
@@ -1698,11 +1747,7 @@ const autoScript = {
16981747 } ] ,
16991748 zipInputData : [ 'cleanDownloadFolder' , function ( results , cb ) {
17001749 overallProgress . beginTask ( 'Zipping up input data' )
1701- const zipFilepath = path . join ( distDir , 'input-data.zip' )
1702- exec (
1703- `zip -j ${ zipFilepath } ${ downloadsDir } /* ${ cacheDir } /* timezones.json osmBoundarySources.json expectedZoneOverlaps.json` ,
1704- cb
1705- )
1750+ assembleAndZipInputData ( cb )
17061751 } ]
17071752}
17081753
0 commit comments