Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Commit

Permalink
Don't sort an empty file list
Browse files Browse the repository at this point in the history
sort just waits for stdin forever

Closes #1

Bug: T145534
  • Loading branch information
MaxSem committed Feb 13, 2017
1 parent cd8f194 commit fcf0211
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/fileParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ function parseSourceFile(srcFile, zoomLevels, zoomLvlIndex, cleanupList) {
}

function sortFile(files, cleanupList) {
if (files.length === 0) {
throw new Err('sortFile() called with empty file list');
}
return tmp.tmpName({prefix: 'tilerator-sorted-'}).then(function (dstFile) {

cleanupList.push(dstFile);
Expand Down Expand Up @@ -268,6 +271,12 @@ function fileParser(filepath, options, addJobCallback) {
}
lastParsedFile = filepath[i];
}

if (tempFiles2.length === 0) {
core.log('info', 'All tiles filtered out, nothing to process');
process.exit();
}

return sortFile(tempFiles2, cleanupList);
}).then(function (sortedFile) {
cleanupList.push(sortedFile);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tilerator-jobprocessor",
"version": "0.0.10",
"version": "0.0.11",
"description": "Processes tile generation jobs",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit fcf0211

Please sign in to comment.