Skip to content

Commit 3166382

Browse files
committed
fix property merging
1 parent 1692cb0 commit 3166382

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

plugin/src/main/java/fish/cichlidmc/cichlid_gradle/run/RunTaskGeneration.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,17 @@ private static List<String> getArgs(Property<ListPatch<String>> config, List<Str
8686

8787
private static void mergeSystemProperties(List<String> args) {
8888
for (int i = 0; i < args.size(); i++) {
89-
String key = args.get(i);
90-
if (!key.startsWith("-D") || i + 1 >= args.size())
89+
if (i + 1 >= args.size()) {
90+
// at the end, nothing to merge
9191
continue;
92+
}
9293

93-
String value = args.get(i + 1);
94-
args.set(i, key + '=' + value);
95-
args.remove(i + 1);
94+
String key = args.get(i);
95+
if (key.startsWith("-D") || key.startsWith("-X")) {
96+
String value = args.get(i + 1);
97+
args.set(i, key + '=' + value);
98+
args.remove(i + 1);
99+
}
96100
}
97101
}
98102

0 commit comments

Comments
 (0)