From 64f4e6cfabc9aa1b565ef40d9da328b72bd3f6de Mon Sep 17 00:00:00 2001 From: Kiril Vatev Date: Wed, 19 Aug 2020 17:58:06 -0400 Subject: [PATCH] if an image already exists, assume it's okay --- scripts/images.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/images.js b/scripts/images.js index 27dc16f..c1481a9 100644 --- a/scripts/images.js +++ b/scripts/images.js @@ -32,6 +32,11 @@ const images = [{ (async () => { for (let image of images) { + // we won't assume malicious intent... if the images exist, don't bother fetching them + if (await fs.exists(image.path)) { + continue; + } + const { url, name } = image; const res = await fetch(url);