8000 - · symfony-cli/symfony-cli@e25d762 · GitHub
[go: up one dir, main page]

Skip to content

Commit e25d762

Browse files
committed
-
1 parent c76c262 commit e25d762

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

commands/local_server_start.go

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,14 @@ var localServerStartCmd = &console.Command{
347347
}
348348

349349
if name == project.DockerComposeWorkerKey {
350+
originalBuildCmdHook := runner.BuildCmdHook
351+
352+
runner.BuildCmdHook = func(cmd *exec.Cmd) error {
353+
cmd.Args = append(cmd.Args, "--detach")
354+
355+
return originalBuildCmdHook(cmd)
356+
}
357+
350358
runner.SuccessHook = func(runner *local.Runner, cmd *exec.Cmd) {
351359
terminal.Eprintln("<info>INFO</> Docker Compose is now up, switching to non detached mode")
352360

@@ -358,25 +366,13 @@ var localServerStartCmd = &console.Command{
358366
// have to do anything specific
359367
runner.SuccessHook = nil
360368
// and we move back AlwaysRestartOnExit to false
361-
originalBuildCmdHook := runner.BuildCmdHook
369+
362370
runner.BuildCmdHook = func(cmd *exec.Cmd) error {
363371
runner.AlwaysRestartOnExit = false
364372

365373
return originalBuildCmdHook(cmd)
366374
}
367375

368-
// disable the docker compose detached mode
369-
pidFile.Args = pidFile.Args[:len(pidFile.Args)-1]
370-
for i := 0; i < (len(pidFile.Args) - 1); {
371-
arg := pidFile.Args[i]
372-
if arg == "--detached" || arg == "-d" {
373-
pidFile.Args = append(pidFile.Args[:i], pidFile.Args[i+1:]...)
374-
continue
375-
}
376-
377-
i++
378-
}
379-
380376
dockerWg.Done()
381377
}
382378
} else if isDockerComposeWorkerConfigured {

local/project/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func (c *FileConfig) parseWorkers() error {
148148

149149
if v, ok := c.Workers[DockerComposeWorkerKey]; ok && v == nil {
150150
c.Workers[DockerComposeWorkerKey] = &Worker{
151-
Cmd: []string{"docker", "compose", "up", "--detach"},
151+
Cmd: []string{"docker", "compose", "up"},
152152
Watch: []string{
153153
"compose.yaml", "compose.override.yaml",
154154
"compose.yml", "compose.override.yml",

0 commit comments

Comments
 (0)
0