Files
blitzkit/scripts/buildAssets/index.ts
T

63 lines
1.8 KiB
TypeScript
Raw Normal View History

2024-01-07 20:07:45 -06:00
import { config } from 'dotenv';
import { argv } from 'process';
import { circleFlags } from './circleFlags';
2024-01-17 11:34:27 -06:00
import { buildConsumableIcons } from './consumableIcons';
2024-01-07 20:07:45 -06:00
import { buildDefinitions } from './definitions';
2024-01-16 16:58:00 -06:00
import { equipmentIcons } from './equipmentIcons';
2024-01-07 20:07:45 -06:00
import { buildModuleIcons } from './moduleIcons';
import { buildScratchedFlags } from './scratchedFlags';
import { buildShellIcons } from './shellIcons';
import { buildTankArmors } from './tankArmors';
import { buildTankIcons } from './tankIcons';
import { buildTankModels } from './tankModels';
config();
const allTargets = argv.includes('--all-targets');
const targets = argv
.find((argument) => argument.startsWith('--target'))
?.split('=')[1]
.split(',');
2024-01-20 21:35:36 -06:00
const production = argv.includes('--production');
2024-01-07 20:07:45 -06:00
if (!targets && !allTargets) throw new Error('No target(s) specified');
if (allTargets || targets?.includes('tankModels')) {
2024-01-20 21:35:36 -06:00
await buildTankModels(production);
2024-01-07 20:07:45 -06:00
}
2024-01-20 22:11:56 -06:00
// no need to await the rest... I have enough ram
if (allTargets || targets?.includes('tankArmor')) {
buildTankArmors(production);
}
if (allTargets || targets?.includes('definitions')) {
buildDefinitions(production);
}
if (allTargets || targets?.includes('tankIcons')) {
buildTankIcons(production);
}
if (allTargets || targets?.includes('scratchedFlags')) {
buildScratchedFlags(production);
}
if (allTargets || targets?.includes('circleFlags')) {
circleFlags(production);
}
2024-01-07 20:07:45 -06:00
if (allTargets || targets?.includes('shellIcons')) {
2024-01-20 22:11:56 -06:00
buildShellIcons(production);
2024-01-07 20:07:45 -06:00
}
if (allTargets || targets?.includes('moduleIcons')) {
2024-01-20 22:11:56 -06:00
buildModuleIcons(production);
2024-01-07 20:07:45 -06:00
}
2024-01-16 16:58:00 -06:00
if (allTargets || targets?.includes('equipmentIcons')) {
2024-01-20 22:11:56 -06:00
equipmentIcons(production);
2024-01-16 16:58:00 -06:00
}
2024-01-17 11:34:27 -06:00
if (allTargets || targets?.includes('consumableIcons')) {
2024-01-20 22:11:56 -06:00
buildConsumableIcons(production);
2024-01-17 11:34:27 -06:00
}