mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
30 lines
1004 B
TypeScript
30 lines
1004 B
TypeScript
import { readdir } from 'fs/promises';
|
|
import { readBase64DVPL } from '../../src/core/blitz/readBase64DVPL';
|
|
import { commitAssets } from '../../src/core/blitzrinth/commitAssets';
|
|
import { FileChange } from '../../src/core/blitzrinth/commitMultipleFiles';
|
|
import { DATA, POI } from './constants';
|
|
|
|
export async function circleFlags(production: boolean) {
|
|
const flags = await readdir(`${DATA}/${POI.flags}`);
|
|
const changes = await Promise.all(
|
|
flags
|
|
.filter(
|
|
(flag) =>
|
|
flag.startsWith('flag_profile-stat_') &&
|
|
!flag.endsWith('@2x.packed.webp.dvpl'),
|
|
)
|
|
.map(async (flag) => {
|
|
const content = await readBase64DVPL(`${DATA}/${POI.flags}/${flag}`);
|
|
const name = flag.match(/flag_profile-stat_(.+)\.packed\.webp/)![1];
|
|
|
|
return {
|
|
content,
|
|
encoding: 'base64',
|
|
path: `flags/circle/${name}.webp`,
|
|
} satisfies FileChange;
|
|
}),
|
|
);
|
|
|
|
await commitAssets('circle flags', changes, production);
|
|
}
|