From af9020b93e27d86ba332aa6b861a98ffb4b12537 Mon Sep 17 00:00:00 2001 From: repolevedavaj Date: Sun, 22 May 2022 13:17:51 +0200 Subject: [PATCH] create avatars directory during compression in case is does not exist yet --- src/repositories/ImageRepository.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/repositories/ImageRepository.ts b/src/repositories/ImageRepository.ts index cec34e6..b50b7d9 100644 --- a/src/repositories/ImageRepository.ts +++ b/src/repositories/ImageRepository.ts @@ -51,6 +51,7 @@ class ImageRepository { } async compressAllImages() { + await FileSystem.makeDirectoryAsync(PLANT_AVATARS_DIRECTORY, {intermediates: true}); for (const image of (await FileSystem.readDirectoryAsync(PLANT_AVATARS_DIRECTORY))) { const imageUri = `${PLANT_AVATARS_DIRECTORY}/${image}`;