From ff80dc4b4392fe9fd40234f172cb07da8c87bcb9 Mon Sep 17 00:00:00 2001 From: Cecilia Sanare Date: Tue, 12 Mar 2024 20:50:40 -0500 Subject: [PATCH] fix: watch mode should work when running as root --- src/utils/steam/mod.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/utils/steam/mod.rs b/src/utils/steam/mod.rs index eba796e..ddeed8a 100644 --- a/src/utils/steam/mod.rs +++ b/src/utils/steam/mod.rs @@ -16,8 +16,16 @@ impl Steam { } fn discover_localconfig() -> String { + let home = home_dir().unwrap(); + let mut home = home.to_str().unwrap(); + + if home == "/root" { + // Fallback to checking all home folders when running as root + home = "/home"; + } + let search: Vec = SearchBuilder::default() - .location(home_dir().unwrap().to_str().unwrap()) + .location(home) .search_input("localconfig") .limit(1) .ext("vdf")