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,9 +53,11 @@ export async function writeLocalFile(
} }
export async function deleteLocalFile(fileName: string): Promise<void> { export async function deleteLocalFile(fileName: string): Promise<void> {
if (localDir) {
const localFileName = join(localDir, fileName); const localFileName = join(localDir, fileName);
await fs.remove(localFileName); await fs.remove(localFileName);
} }
}
// istanbul ignore next // istanbul ignore next
export async function ensureDir(dirName): Promise<void> { export async function ensureDir(dirName): Promise<void> {