Execute (HostTask) executes a command in a container, by default the web container, and returns stdout, stderr, err
()
| 78 | // Execute (HostTask) executes a command in a container, by default the web container, |
| 79 | // and returns stdout, stderr, err |
| 80 | func (c ExecHostTask) Execute() error { |
| 81 | cwd, _ := os.Getwd() |
| 82 | err := os.Chdir(c.app.GetAppRoot()) |
| 83 | if err != nil { |
| 84 | return err |
| 85 | } |
| 86 | |
| 87 | bashPath := "bash" |
| 88 | if nodeps.IsWindows() { |
| 89 | bashPath = util.FindBashPath() |
| 90 | } |
| 91 | |
| 92 | args := []string{ |
| 93 | "-c", |
| 94 | c.exec, |
| 95 | } |
| 96 | |
| 97 | err = exec.RunInteractiveCommand(bashPath, args) |
| 98 | |
| 99 | _ = os.Chdir(cwd) |
| 100 | |
| 101 | return err |
| 102 | } |
| 103 | |
| 104 | // Execute (ComposerTask) runs a Composer command in the web container |
| 105 | // and returns stdout, stderr, err |
nothing calls this directly
no test coverage detected