Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/main/java/me/itzg/helpers/http/SharedFetchArgs.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class SharedFetchArgs {
private final Options.OptionsBuilder optionsBuilder = Options.builder();

@Option(names = "--http-response-timeout", defaultValue = "${env:FETCH_RESPONSE_TIMEOUT:-PT30S}",
paramLabel = "DURATION",
description = "The response timeout to apply to HTTP operations. Parsed from ISO-8601 format. "
+ "Default: ${DEFAULT-VALUE}"
)
Expand All @@ -27,13 +28,16 @@ public void setResponseTimeout(Duration timeout) {
}

@Option(names = "--tls-handshake-timeout", defaultValue = "${env:FETCH_TLS_HANDSHAKE_TIMEOUT:-PT30S}",
paramLabel = "DURATION",
description = "Default: ${DEFAULT-VALUE}"
)
public void setTlsHandshakeTimeout(Duration timeout) {
optionsBuilder.tlsHandshakeTimeout(timeout);
}

@Option(names = "--connection-pool-max-idle-timeout", defaultValue = "${env:FETCH_CONNECTION_POOL_MAX_IDLE_TIMEOUT}")
@Option(names = "--connection-pool-max-idle-timeout", defaultValue = "${env:FETCH_CONNECTION_POOL_MAX_IDLE_TIMEOUT}",
paramLabel = "DURATION"
)
public void setConnectionPoolMaxIdleTimeout(Duration timeout) {
optionsBuilder.maxIdleTimeout(timeout);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
import static me.itzg.helpers.modrinth.ModrinthApiClient.pickVersionFile;

@CommandLine.Command(name = "install-modrinth-modpack",
description = "Supports installation of Modrinth modpacks along with the associated mod loader"
description = "Supports installation of Modrinth modpacks along with the associated mod loader",
mixinStandardHelpOptions = true
)
@Slf4j
public class InstallModrinthModpackCommand implements Callable<Integer> {
Expand All @@ -69,7 +70,7 @@ public class InstallModrinthModpackCommand implements Callable<Integer> {
String gameVersion;

@Option(names = "--loader", description = "Valid values: ${COMPLETION-CANDIDATES}")
Loader loader;
ModpackLoader loader;

@Option(names = "--default-version-type", defaultValue = "release",
description = "Valid values: ${COMPLETION-CANDIDATES}"
Expand Down Expand Up @@ -135,7 +136,7 @@ private ModrinthModpackManifest processModpack(ProjectRef projectRef, ModrinthMo
)
.flatMap(project ->
apiClient.resolveProjectVersion(
project, projectRef, loader, gameVersion, defaultVersionType
project, projectRef, loader.asLoader(), gameVersion, defaultVersionType
)
.switchIfEmpty(Mono.defer(() -> Mono.error(new InvalidParameterException(
"Unable to find version given " + projectRef))))
Expand Down
1 change: 1 addition & 0 deletions src/main/java/me/itzg/helpers/modrinth/Loader.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public enum Loader {
fabric("mods"),
quilt("mods"),
forge("mods"),
bukkit("plugins"),
spigot("plugins"),
Expand Down
13 changes: 13 additions & 0 deletions src/main/java/me/itzg/helpers/modrinth/ModpackLoader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package me.itzg.helpers.modrinth;

/**
* Valid loader values for modpacks
*/
public enum ModpackLoader {
fabric,
forge;

public Loader asLoader() {
return Loader.valueOf(this.name());
}
}