fix(compose): add project directory option to compose command [EE-7093] (#11870)

This commit is contained in:
Oscar Zhou
2024-05-30 08:47:07 +12:00
committed by GitHub
parent 9e0e0a12fa
commit 0c870bf37b
2 changed files with 13 additions and 0 deletions
@@ -126,6 +126,10 @@ func (wrapper *PluginWrapper) command(command composeCommand, options libstack.O
command.WithHost(options.Host)
}
if options.ProjectDir != "" {
command.WithProjectDirectory(options.ProjectDir)
}
var stderr bytes.Buffer
args := []string{}
@@ -237,6 +241,10 @@ func (command *composeCommand) WithEnvFilePath(envFilePath string) {
command.globalArgs = append(command.globalArgs, "--env-file", envFilePath)
}
func (command *composeCommand) WithProjectDirectory(projectDir string) {
command.globalArgs = append(command.globalArgs, "--project-directory", projectDir)
}
func (command *composeCommand) ToArgs() []string {
return append(command.globalArgs, command.subCommandAndArgs...)
}