improved script
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user