Fix: prioritize non-installer executables over depth in findMainExe
Build & Deploy / build-and-deploy (push) Failing after 33s

The sort was: depth → non-installer → size.
This meant a root-level SETUP.EXE (depth 1, installer) beat a
subdirectory FALLOUT.EXE (depth 2, non-installer).

New sort: non-installer → depth → size.
Now any non-installer game EXE wins over installers regardless of depth.
This commit is contained in:
Hermes Agent
2026-05-29 09:28:05 +02:00
parent 27a9c180d7
commit 12db0e9bb9
@@ -261,8 +261,8 @@ public class UploadResource {
if (candidates.isEmpty()) return null;
candidates.sort(Comparator
.comparingInt(Candidate::depth)
.thenComparingInt(c -> c.isInstaller() ? 1 : 0)
.comparingInt(c -> c.isInstaller() ? 1 : 0) // non-installer first
.thenComparingInt(Candidate::depth)
.thenComparingLong(c -> -c.size())); // larger files first
return candidates.getFirst().path();