From c8a5fa3e28829215c61afdcd52ab72004a59fd9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matev=C5=BE=20Jekovec?= Date: Mon, 28 Jul 2025 15:32:07 +0200 Subject: [PATCH] fix: Don't overwrite compose.yaml on rofl init --- cmd/rofl/mgmt.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/rofl/mgmt.go b/cmd/rofl/mgmt.go index f64bf75d..01abd34a 100644 --- a/cmd/rofl/mgmt.go +++ b/cmd/rofl/mgmt.go @@ -710,9 +710,9 @@ func replaceArtifacts(manifest *buildRofl.Manifest, newArtifacts *buildRofl.Arti return changes, nil } -// detectAndCreateComposeFile detects the existing compose.yaml-like file and returns its filename. Otherwise, creates an empty default compose.yaml. +// detectOrCreateComposeFile detects the existing compose.yaml-like file and returns its filename. If it doesn't exist, it creates compose.yaml and populates it. func detectOrCreateComposeFile() string { - for _, filename := range []string{"rofl-compose.yaml", "rofl-compose.yml", "docker-compose.yaml", "docker-compose.yml", "compose.yml"} { + for _, filename := range []string{"rofl-compose.yaml", "rofl-compose.yml", "docker-compose.yaml", "docker-compose.yml", "compose.yml", "compose.yaml"} { if _, err := os.Stat(filename); err == nil { return filename }