fix(stack): unable to delete invalid stack [EE-5753] (#11813)

This commit is contained in:
Oscar Zhou
2024-06-04 11:34:02 +12:00
committed by GitHub
parent 9c70a43ac3
commit 4a7f96caf6
5 changed files with 48 additions and 18 deletions
@@ -136,7 +136,12 @@ func (wrapper *PluginWrapper) command(command composeCommand, options libstack.O
args = append(args, command.ToArgs()...)
cmd := exec.Command(program, args...)
cmd.Dir = options.WorkingDir
if options.WorkingDir != "" {
// Specify an non-exist working directory will cause the failure
// of the "docker-compose down" command even if the project name
// is correct.
cmd.Dir = options.WorkingDir
}
if wrapper.configPath != "" || len(options.Env) > 0 {
cmd.Env = os.Environ()