From 2ce083222e55e46bb1f310fd127b1c4d677123b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 6 Dec 2023 10:19:13 -0600 Subject: [PATCH] fix: tighter all targets integration --- scripts/buildAssets.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/buildAssets.ts b/scripts/buildAssets.ts index 078e80eef..4cafcf637 100644 --- a/scripts/buildAssets.ts +++ b/scripts/buildAssets.ts @@ -70,9 +70,9 @@ const targets = argv ?.split('=')[1] .split(','); -if (!targets) throw new Error('No target(s) specified'); +if (!targets && !allTargets) throw new Error('No target(s) specified'); -if (allTargets || targets.includes('tankDefinitions')) { +if (allTargets || targets?.includes('tankDefinitions')) { console.log('Building tank definitions...'); const tankDefinitions: TankDefinitions = {}; @@ -147,8 +147,8 @@ if (allTargets || targets.includes('tankDefinitions')) { if ( allTargets || - targets.includes('bigTankIcons') || - targets.includes('smallTankIcons') + targets?.includes('bigTankIcons') || + targets?.includes('smallTankIcons') ) { console.log('Building tank icons...'); @@ -177,14 +177,14 @@ if ( .replace(/~res:\//, '') .replace(/\..+/, '')}.packed.webp.dvpl`; - if (targets.includes('bigTankIcons')) { + if (allTargets || targets?.includes('bigTankIcons')) { changes.push({ content: await readBase64DVPL(big), encoding: 'base64', path: `icons/big/${id}.webp`, }); } - if (targets.includes('smallTankIcons')) { + if (allTargets || targets?.includes('smallTankIcons')) { changes.push({ content: await readBase64DVPL(small), encoding: 'base64', @@ -206,7 +206,7 @@ if ( ); } -if (allTargets || targets.includes('scratchedFlags')) { +if (allTargets || targets?.includes('scratchedFlags')) { console.log('Building scratched flags...'); const flags = await readdir(`${DATA}/${DOI.flags}`); @@ -239,7 +239,7 @@ if (allTargets || targets.includes('scratchedFlags')) { ); } -if (allTargets || targets.includes('circleFlags')) { +if (allTargets || targets?.includes('circleFlags')) { const flags = await readdir(`${DATA}/${DOI.flags}`); commitMultipleFiles(