From 1e875540fc3f9dd491caf7b0b75dc9590a52d1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 21 Feb 2024 07:45:48 -0600 Subject: [PATCH] Update tankModels.ts --- scripts/buildAssets/tankModels.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/buildAssets/tankModels.ts b/scripts/buildAssets/tankModels.ts index 2871216bc..ea1965ef6 100644 --- a/scripts/buildAssets/tankModels.ts +++ b/scripts/buildAssets/tankModels.ts @@ -5,10 +5,12 @@ import { extractModel } from '../../src/core/blitz/extractModel'; import { readXMLDVPL } from '../../src/core/blitz/readXMLDVPL'; import { readYAMLDVPL } from '../../src/core/blitz/readYAMLDVPL'; import { toUniqueId } from '../../src/core/blitz/toUniqueId'; -import { AssetCommit } from '../../src/core/github/assetCommit'; +// import { AssetCommit } from '../../src/core/github/assetCommit'; import { DATA, POI } from './constants'; import { VehicleDefinitionList } from './definitions'; import { TankParameters } from './tankIcons'; +import { commitAssets } from '../../src/core/blitzkrieg/commitAssets'; +import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles'; interface VehicleCustomization { armorColor: string; @@ -24,9 +26,9 @@ export async function tankModels(production: boolean) { for (const nationIndex in nations) { const nation = nations[nationIndex]; - // const changes: FileChange[] = []; + const changes: FileChange[] = []; const assetCommit = new AssetCommit(`tank models ${nation}`, production); - const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>( + // const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>( `${DATA}/${POI.vehicleDefinitions}/${nation}/list.xml.dvpl`, ); const customization = await readXMLDVPL<{ root: VehicleCustomization }>( @@ -59,15 +61,15 @@ export async function tankModels(production: boolean) { // writeFile(`test.${tankKey}.glb`, await nodeIO.writeBinary(model)); - assetCommit.add( - `3d/tanks/models/${id}.glb`, - Buffer.from(await nodeIO.writeBinary(model)).toString('base64'), - 'base64', - ); + changes.push({ + path: `3d/tanks/models/${id}.glb`, + content: Buffer.from(await nodeIO.writeBinary(model)).toString('base64'), + format: 'base64', + }); }), ); - assetCommit.push(); - // await commitAssets(`tank models ${nation}`, changes, production); + // assetCommit.push(); + await commitAssets(`tank models ${nation}`, changes, production); } }