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

This commit is contained in:
Oscar Zhou
2024-05-30 08:46:48 +12:00
committed by GitHub
parent c94cfb1308
commit b23b0f7c8d
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...)
}