check for single url files/ files ending in url (#186)

This commit is contained in:
lukaarma 2020-07-22 03:56:57 +02:00 committed by GitHub
parent 78e5818cc3
commit 3144014a34
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,6 +127,7 @@ export async function parseInputFile(inputFile: string, defaultOutDir: string,
if (foundUrl) {
outDirList.push(...Array(guidList.length - outDirList.length)
.fill(defaultOutDir));
foundUrl = false;
}
const guids: Array<string> | null = await extractGuids(line, apiClient);
@ -140,6 +141,12 @@ export async function parseInputFile(inputFile: string, defaultOutDir: string,
}
}
// if foundUrl is still true after the loop we have some url without an outDir
if (foundUrl) {
outDirList.push(...Array(guidList.length - outDirList.length)
.fill(defaultOutDir));
}
return [guidList, outDirList];
}