mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: depot
This commit is contained in:
1 parent
58002958bf
commit
067178e94d
4 files changed
+10
-6
No files matched your search
@@ -5,8 +5,8 @@ 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 { commitAssets } from '../../src/core/blitzkrieg/commitAssets';
|
||||
import { FileChange } from '../../src/core/blitzkrieg/commitMultipleFiles';
|
||||
import { AssetCommit } from '../../src/core/github/assetCommit';
|
||||
import { DATA, POI } from './constants';
|
||||
import { VehicleDefinitionList } from './definitions';
|
||||
import { TankParameters } from './tankIcons';
|
||||
@@ -26,7 +26,7 @@ export async function tankModels(production: boolean) {
|
||||
for (const nationIndex in nations) {
|
||||
const nation = nations[nationIndex];
|
||||
const changes: FileChange[] = [];
|
||||
const assetCommit = new AssetCommit(`tank models ${nation}`, production);
|
||||
// const assetCommit = new AssetCommit(`tank models ${nation}`, production);
|
||||
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||
`${DATA}/${POI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
||||
);
|
||||
@@ -68,7 +68,7 @@ export async function tankModels(production: boolean) {
|
||||
}),
|
||||
);
|
||||
|
||||
assetCommit.push();
|
||||
// await commitAssets(`tank models ${nation}`, changes, production);
|
||||
// assetCommit.push();
|
||||
await commitAssets(`tank models ${nation}`, changes, production);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import decompress from 'decompress';
|
||||
import { existsSync } from 'fs';
|
||||
import { mkdir, writeFile } from 'fs/promises';
|
||||
import { mkdir, readdir, writeFile } from 'fs/promises';
|
||||
|
||||
if (!existsSync('temp')) {
|
||||
console.log('Creating temp directory...');
|
||||
@@ -25,3 +25,5 @@ await fetch(
|
||||
|
||||
console.log('Unzipping...');
|
||||
decompress('temp/depotDownloader.zip', 'temp/depotDownloader');
|
||||
|
||||
console.log(await readdir('temp/depotDownloader'));
|
||||
@@ -40,6 +40,6 @@ export const createBlob = throttle(
|
||||
}
|
||||
}
|
||||
},
|
||||
(5000 / (60 * 60 * 1000)) * 0.95, // 5% less than max rate
|
||||
(5000 / (60 * 60 * 1000)) * 0.9,
|
||||
{ trailing: true },
|
||||
);
|
||||
@@ -21,6 +21,8 @@ export class AssetCommit {
|
||||
}
|
||||
|
||||
async push() {
|
||||
if (this.blobs.length === 0) return;
|
||||
|
||||
const latestCommitSha = (
|
||||
await octokit.git.getRef({
|
||||
owner: 'tresabhi',
|
||||
|
||||
Reference in new issue
Block a user