fix: deleteLocalFile only if localDir is defined

This commit is contained in:
Rhys Arkins 2020-08-25 09:39:03 +02:00
parent 123a0f3775
commit 2dc0fd6a4c

View file

@ -53,8 +53,10 @@ export async function writeLocalFile(
}
export async function deleteLocalFile(fileName: string): Promise<void> {
const localFileName = join(localDir, fileName);
await fs.remove(localFileName);
if (localDir) {
const localFileName = join(localDir, fileName);
await fs.remove(localFileName);
}
}
// istanbul ignore next