From 4f0cc56f6b7a2186ecd78f9a9919ede75c1aeb9b Mon Sep 17 00:00:00 2001 From: Philip-21 Date: Tue, 23 Jan 2024 23:57:38 +0100 Subject: [PATCH] making changes Signed-off-by: Philip-21 --- internal/stacks/stack_manager.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/stacks/stack_manager.go b/internal/stacks/stack_manager.go index 8d1c74b6..8291d6c6 100644 --- a/internal/stacks/stack_manager.go +++ b/internal/stacks/stack_manager.go @@ -187,6 +187,7 @@ func (s *StackManager) InitStack(options *types.InitOptions) (err error) { if err := s.writeDockerComposeOverride(compose); err != nil { return fmt.Errorf("failed to write docker-compose.override.yml: %s", err) } + options.CustomPath = "docker-compose.yml" if err := s.copyToDockerComposeOverride(options.CustomPath); err != nil { return fmt.Errorf("failed to copy file data to docker-compose.override.yml: %s", err) } @@ -422,10 +423,8 @@ func (s *StackManager) copyToDockerComposeOverride(dockerComposePath string) err comments := "# Copy custom file to docker-compose.override.yml file\n" bytes := []byte(comments) - if dockerComposePath == "docker-compose.yml" { - dockerComposePath = filepath.Join(s.Stack.StackDir, "docker-compose.yml") - } - overrideComposeContent, err := os.ReadFile(dockerComposePath) + dockerPath := filepath.Join(s.Stack.StackDir, dockerComposePath) + overrideComposeContent, err := os.ReadFile(dockerPath) if err != nil && os.IsNotExist(err) { return err }