change commands to use flatpak-spawn --host

This commit is contained in:
2022-07-14 22:06:16 +02:00
parent 4adb9a9708
commit f622509b0f
2 changed files with 14 additions and 4 deletions

View File

@@ -147,7 +147,9 @@ impl ToolbxContainer {
}
pub fn stop(&mut self) -> Result<(), ToolbxError> {
let output = Command::new("podman")
let output = Command::new("flatpak-spawn")
.arg("--host") //Command::new("podman")
.arg("podman")
.arg("stop")
.arg(self.name.clone())
.output();
@@ -178,7 +180,9 @@ impl ToolbxContainer {
}
pub fn start(&mut self) -> Result<(), ToolbxError> {
let output = Command::new("podman")
let output = Command::new("flatpak-spawn")
.arg("--host") //Command::new("podman")
.arg("podman")
.arg("start")
.arg(self.name.clone())
.output();
@@ -258,12 +262,16 @@ fn test_start_non_existing_containter() {
}
pub fn run_cmd_toolbx_list_containers() -> String {
let output = Command::new("toolbox")
let output = Command::new("flatpak-spawn")
.arg("--host")
.arg("toolbox")
.arg("list")
.arg("--containers")
.output()
.expect("Failed to execute command");
println!("{:?}", String::from_utf8_lossy(&output.stdout).to_string());
String::from_utf8_lossy(&output.stdout).to_string()
}