MCPcopy Create free account
hub / github.com/Shazbot/WH3-Mod-Manager / addFakeUpdate

Function addFakeUpdate

src/packFileSerializer.ts:1015–1027  ·  view source on GitHub ↗
(pathSource: string, pathTarget: string)

Source from the content-addressed store, hash-verified

1013 }
1014};
1015export const addFakeUpdate = async (pathSource: string, pathTarget: string) => {
1016 const randomHexString = [...Array(100)].map(() => Math.floor(Math.random() * 16).toString(16)).join("");
1017 const toAdd = [
1018 {
1019 name: "whmm_update.txt",
1020 file_size: randomHexString.length,
1021 start_pos: 0,
1022 // is_compressed: 0,
1023 schemaFields: [{ type: "Buffer", fields: [{ type: "Buffer", val: Buffer.from(randomHexString) }] }],
1024 } as PackedFile,
1025 ];
1026 await writeCopyPack(pathSource, pathTarget, toAdd);
1027};
1028export const createOverwritePack = async (
1029 pathSource: string,
1030 pathTarget: string,

Callers 1

registerIpcMainListenersFunction · 0.90

Calls 1

writeCopyPackFunction · 0.85

Tested by

no test coverage detected