Fix bug where WmsaHome wouldn't look in /var/lib/wmsa as a fallback

This commit is contained in:
Viktor Lofgren 2023-03-25 09:30:39 +01:00
parent 45dd9fea25
commit 2f2c86a9f5

View File

@ -47,8 +47,7 @@ public class WmsaHome {
// Developers probably have a "run/" somewhere upstream from cwd.
//
return Stream.iterate(Paths.get("").toAbsolutePath(), Path::getParent)
.takeWhile(Files::exists)
return Stream.iterate(Paths.get("").toAbsolutePath(), f -> f != null && Files.exists(f), Path::getParent)
.filter(p -> Files.exists(p.resolve("run/env")))
.filter(p -> Files.exists(p.resolve("run/setup.sh")))
.map(p -> p.resolve("run"))