improved script

This commit is contained in:
Mathias Rothenhaeusler
2024-05-21 07:48:52 +02:00
parent 5044f6a19c
commit 1dd669697e
6 changed files with 85 additions and 31 deletions
+5 -4
View File
@@ -28,6 +28,7 @@ pub fn start_docker_compose(
let base_dir: BaseDirs = BaseDirs::new().unwrap();
let absolute = base_dir.home_dir().join(container_path);
let compose_path = Path::new(&absolute);
println!("{}", compose_path.to_str().unwrap());
let running: bool = is_container_running(service_name)?;
@@ -37,9 +38,9 @@ pub fn start_docker_compose(
}
if start && compose_path.exists() {
let status: ExitStatus = Command::new("docker-compose")
let status: ExitStatus = Command::new("docker")
.current_dir(compose_path)
.args(["up", "-d"])
.args(["compose", "up", "-d"])
.status()?;
if status.success() {
@@ -55,9 +56,9 @@ pub fn start_docker_compose(
}
if !start && compose_path.exists() {
let status: ExitStatus = Command::new("docker-compose")
let status: ExitStatus = Command::new("docker")
.current_dir(compose_path)
.args(["down"])
.args(["compose", "down"])
.status()?;
if status.success() {