MCPcopy Create free account
hub / github.com/nhost/nhost / Wrapper

Method Wrapper

cli/dockercompose/dockercompose.go:120–142  ·  view source on GitHub ↗
(ctx context.Context, extraArgs ...string)

Source from the content-addressed store, hash-verified

118}
119
120func (dc *DockerCompose) Wrapper(ctx context.Context, extraArgs ...string) error {
121 args := []string{ //nolint:prealloc
122 "compose",
123 "--project-directory", dc.workingDir,
124 "-f", dc.filepath,
125 "-p", dc.projectName,
126 }
127 args = append(args, extraArgs...)
128
129 cmd := exec.CommandContext(
130 ctx,
131 "docker",
132 args...,
133 )
134 cmd.Stdout = os.Stdout
135 cmd.Stderr = os.Stderr
136
137 if err := cmd.Run(); err != nil {
138 return fmt.Errorf("failed to run docker compose: %w", err)
139 }
140
141 return nil
142}
143
144func (dc *DockerCompose) ApplyMetadata(ctx context.Context, endpoint string) error {
145 cmd := exec.CommandContext( //nolint:gosec

Callers 2

restartFunction · 0.80
commandComposeFunction · 0.80

Calls 2

ErrorfMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected