From f836bdcff254aa713898fac4adbd814075a70d11 Mon Sep 17 00:00:00 2001 From: Aurora Date: Tue, 29 Jul 2025 11:55:51 +0100 Subject: [PATCH] Allow specifying an output with nogui --- .../geysermc/pack/converter/bootstrap/Main.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/bootstrap/src/main/java/org/geysermc/pack/converter/bootstrap/Main.java b/bootstrap/src/main/java/org/geysermc/pack/converter/bootstrap/Main.java index 5fbe4ba..bba4f9c 100644 --- a/bootstrap/src/main/java/org/geysermc/pack/converter/bootstrap/Main.java +++ b/bootstrap/src/main/java/org/geysermc/pack/converter/bootstrap/Main.java @@ -62,13 +62,25 @@ public class Main { if (args.contains("nogui")) { if (!args.contains("--input")) { throw new IllegalArgumentException("No input provided."); + } else if (args.indexOf("--input") + 1 >= args.size()) { + throw new IllegalArgumentException("Input specified with no value."); } String inputPath = args.get(args.indexOf("--input") + 1); + String outputPath = inputPath.substring(0, inputPath.length() - 4); + + if (args.contains("--output")) { + if (args.indexOf("--output") + 1 >= args.size()) { + throw new IllegalArgumentException("Output specified with no value."); + } + + outputPath = args.get(args.indexOf("--output") + 1); + } + new PackConverter() .input(Path.of(inputPath)) - .output(Path.of(inputPath.substring(0, inputPath.length() - 4))) + .output(Path.of(outputPath)) .converters(Converters.defaultConverters(debug)) .convert() .pack();