Skip to content

Commit

Permalink
making changes
Browse files Browse the repository at this point in the history
Signed-off-by: Philip-21 <[email protected]>
  • Loading branch information
Philip-21 committed Jan 23, 2024
1 parent 15aa781 commit 4f0cc56
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions internal/stacks/stack_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 4f0cc56

Please sign in to comment.