Only run command if file exists
@@ -380,6 +380,12 @@ fn flatpak_should_use_host_terminal() -> bool {
const FLATPAK_INFO_PATH: &str = "/.flatpak-info";
+ // The de-facto way of checking whether one is inside of a Flatpak container is by checking for
+ // the presence of /.flatpak-info in the filesystem
+ if !Path::new(FLATPAK_INFO_PATH).exists() {
+ return false;
+ }
+
// Ensure flatpak-spawn --host can execute a basic command
let host_available = Command::new("flatpak-spawn")
.arg("--host")
@@ -387,7 +393,5 @@ fn flatpak_should_use_host_terminal() -> bool {
.status()
.unwrap();
- // The de-facto way of checking whether one is inside of a Flatpak container is by checking for
- // the presence of /.flatpak-info in the filesystem
- Path::new(FLATPAK_INFO_PATH).exists() && host_available.success()
+ host_available.success()
}
