use up and down instead

This commit is contained in:
2024-06-30 17:48:29 -04:00
parent 9df422ca30
commit bab23501ac

View File

@@ -42,7 +42,11 @@ async fn start(paths: &[impl AsRef<Path>]) -> Result<(), MyError> {
.into_iter() .into_iter()
.map(|path| { .map(|path| {
let mut command = tokio::process::Command::new("docker"); let mut command = tokio::process::Command::new("docker");
command.arg("compose").arg("start").current_dir(path); command
.arg("compose")
.arg("up")
.arg("--detach")
.current_dir(path);
(path, command) (path, command)
}) })
.map(|(path, mut command)| (path, tokio::spawn(command.output()))); .map(|(path, mut command)| (path, tokio::spawn(command.output())));
@@ -66,7 +70,7 @@ async fn stop(paths: &[impl AsRef<Path>]) -> Result<(), MyError> {
.into_iter() .into_iter()
.map(|path| { .map(|path| {
let mut command = tokio::process::Command::new("docker"); let mut command = tokio::process::Command::new("docker");
command.arg("compose").arg("stop").current_dir(path); command.arg("compose").arg("down").current_dir(path);
(path, command) (path, command)
}) })
.map(|(path, mut command)| (path, tokio::spawn(command.output()))); .map(|(path, mut command)| (path, tokio::spawn(command.output())));