From d2459492c3c050eb1f3bef506809b5a7f3b60146 Mon Sep 17 00:00:00 2001 From: Nemesis Date: Sun, 19 Feb 2023 20:21:29 +0100 Subject: [PATCH] feat(costumes): check if emblems exists --- nier-reincarnation/costumes/index.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nier-reincarnation/costumes/index.mjs b/nier-reincarnation/costumes/index.mjs index 634cfa7..ca8ad87 100644 --- a/nier-reincarnation/costumes/index.mjs +++ b/nier-reincarnation/costumes/index.mjs @@ -20,6 +20,11 @@ const { data: emblems } = await fetch( process.exit(1); }); +if (!emblems || emblems.length === 0) { + console.error(`Got 0 emblems from "${env.STRAPI_BASE_API_URL}/rein-emblems". You may want to run "npm run import:emblems".`) + process.exit(1); +} + let costumes = []; try {