MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / getVersionFromManifest

Method getVersionFromManifest

daemon/src/service/mod_service.ts:58–67  ·  view source on GitHub ↗

* Try to get version from MANIFEST.MF

(zip: any, entries: any)

Source from the content-addressed store, hash-verified

56 * Try to get version from MANIFEST.MF
57 */
58 private async getVersionFromManifest(zip: any, entries: any): Promise<string | null> {
59 const manifestPath = "META-INF/MANIFEST.MF";
60 if (!entries[manifestPath]) return null;
61 const data = await zip.entryData(manifestPath);
62 const content = data.toString();
63 // Use regex to match Implementation-Version or Specification-Version
64 const match = content.match(/Implementation-Version:\s*(.+)/i)
65 || content.match(/Specification-Version:\s*(.+)/i);
66 return match ? match[1].trim() : null;
67 }
68
69 private async parseJarMetadata(jarPath: string): Promise<Partial<ModInfo> | null> {
70 const zip = new StreamZip.async({ file: jarPath });

Callers 1

parseJarMetadataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected