diff --git a/internal/command/init.go b/internal/command/init.go index bda5592..e2bd935 100644 --- a/internal/command/init.go +++ b/internal/command/init.go @@ -153,7 +153,10 @@ acts as a namespace when multiple score files and containers are used. // create and write the default provisioners file if it doesn't already exist dst := "zz-default" + loader.DefaultSuffix - if f, err := os.OpenFile(filepath.Join(sd.Path, dst), os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644); err != nil { + oldDest := "99-default" + loader.DefaultSuffix + if _, err := os.Stat(filepath.Join(sd.Path, oldDest)); err == nil { + slog.Info(fmt.Sprintf("Default provisioners yaml file '%s' already exists, not overwriting it", oldDest)) + } else if f, err := os.OpenFile(filepath.Join(sd.Path, dst), os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0644); err != nil { if !errors.Is(err, os.ErrExist) { return fmt.Errorf("failed to open default provisioners for writing: %w", err) }