Skip to content

Commit b47b560

Browse files
committed
Allow globs to not exist while copying
1 parent 1d9aa65 commit b47b560

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

task/BuildOTPGraph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const packData = function (commit, router) {
8181
`${path}/*gtfs.zip`,
8282
`${path}/*.json`,
8383
...osmFiles,
84-
`${path}/${router.dem}.tif`,
84+
`${path}/*.tif`,
8585
],
8686
`router-${router.id}`,
8787
err => {

task/ZipTask.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ function extractAllFiles(zipPath, destinationPath) {
134134
function zipWithGlobIntoDir(zipFile, glob, zipDir, cb) {
135135
try {
136136
execSync(`rm -rf ${zipDir} && mkdir ${zipDir}`);
137-
execSync(`cp ${glob.join(' ')} ${zipDir}`);
137+
// We don't want to command to fail if nothing matching a glob is found
138+
execSync(`cp ${glob.join(' ')} ${zipDir} 2>/dev/null || :`);
138139
execSync(`zip -rm ${zipFile} ${zipDir}`);
139140
process.stdout.write(`Created ${zipFile}\n`);
140141
cb();

0 commit comments

Comments
 (0)