From 260b3ca3f6011abfe0785f528446684b4c85d315 Mon Sep 17 00:00:00 2001 From: WinPlay02 Date: Fri, 26 Jul 2024 12:57:55 +0200 Subject: [PATCH] FIXED: Error of fetching a file from a zip, after it has been closed FIXED: Default 'manifest-source' parameter --- .../groovy/com/github/winplay02/gitcraft/GitCraftCli.groovy | 2 +- .../winplay02/gitcraft/manifest/BaseMetadataProvider.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/groovy/com/github/winplay02/gitcraft/GitCraftCli.groovy b/src/main/groovy/com/github/winplay02/gitcraft/GitCraftCli.groovy index cb41d2b..74e9267 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/GitCraftCli.groovy +++ b/src/main/groovy/com/github/winplay02/gitcraft/GitCraftCli.groovy @@ -53,7 +53,7 @@ class GitCraftCli { cli_args._(longOpt: 'create-version-branches', 'Creates a separate branch for each version, including linear versions. This may be useful for quickly switching between multiple versions.') cli_args._(longOpt: 'create-stable-version-branches', 'Creates a separate branch for each stable linear version. This may be useful for quickly switching between multiple versions.') cli_args._(longOpt: 'sort-json', 'Sorts JSON objects contained in JSON files (e.g. models, language files, ...) in natural order. This is disabled by default as it modifies original data.') - cli_args._(longOpt: 'manifest-source', "Specifies the manifest source used to fetch the available versions, the mapping to semantic versions and the dependencies between versions. The Minecraft Launcher Meta (from Mojang) is selected by default. Possible values are: ${Arrays.stream(ManifestSource.values()).map(Object::toString).collect(Collectors.joining(", "))}", type: ManifestSource, argName: "mapping", defaultValue: "mojang_minecraft_launcher"); + cli_args._(longOpt: 'manifest-source', "Specifies the manifest source used to fetch the available versions, the mapping to semantic versions and the dependencies between versions. The Minecraft Launcher Meta (from Mojang) is selected by default. Possible values are: ${Arrays.stream(ManifestSource.values()).map(Object::toString).collect(Collectors.joining(", "))}", type: ManifestSource, argName: "mapping", defaultValue: "mojang"); cli_args.h(longOpt: 'help', 'Displays this help screen'); return cli_args; } diff --git a/src/main/groovy/com/github/winplay02/gitcraft/manifest/BaseMetadataProvider.java b/src/main/groovy/com/github/winplay02/gitcraft/manifest/BaseMetadataProvider.java index a238e04..a9c03ce 100644 --- a/src/main/groovy/com/github/winplay02/gitcraft/manifest/BaseMetadataProvider.java +++ b/src/main/groovy/com/github/winplay02/gitcraft/manifest/BaseMetadataProvider.java @@ -176,6 +176,7 @@ protected final T loadVersionMetadata(Path targetFile, Class metadataClas if (zipFile.isPresent()) { targetFile = zipFile.get(); } + return SerializationHelper.deserialize(SerializationHelper.fetchAllFromPath(targetFile), metadataClass); } } else { MiscHelper.panic("unknown metadata file extension: %s", targetFile);