From 7cc42622c88a75f68df60ac8b323ae68d351e4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 22 Jan 2024 16:27:48 -0800 Subject: [PATCH] Gracefully handle magefiles with Default set - break on empty line, separating targets from "* default target" notice - trim * suffix from default target --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 6a92e9f..2e42331 100644 --- a/main.go +++ b/main.go @@ -62,8 +62,10 @@ func main() { line := scan.Text() if strings.HasPrefix(line, "Targets:") { continue + } else if strings.TrimSpace(line) == "" { + break } - line = strings.TrimSpace(line) + line = strings.TrimSpace(strings.ReplaceAll(line, "*", "")) targets = append(targets, line) }