From 6f9ee95c0b37f539402801479df4df66b82d7f38 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Mon, 13 Jan 2025 10:54:52 -0500 Subject: [PATCH] accept newline-delimited packages and replaces (#46) * accept newline-delimited packages and replaces Signed-off-by: Jason Hall * drop ds_store Signed-off-by: Jason Hall --------- Signed-off-by: Jason Hall --- .gitignore | 4 +++- cmd/gobump/root.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3ecec7b..4095e49 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,6 @@ # Go workspace file go.work -bin* \ No newline at end of file +bin* + +.DS_Store diff --git a/cmd/gobump/root.go b/cmd/gobump/root.go index 9ce308e..655ebfd 100644 --- a/cmd/gobump/root.go +++ b/cmd/gobump/root.go @@ -50,7 +50,7 @@ var rootCmd = &cobra.Command{ return fmt.Errorf("failed to parse bump file %q: %v", rootFlags.bumpFile, err) } } else { - packages := strings.Split(rootFlags.packages, " ") + packages := strings.Fields(rootFlags.packages) for i, pkg := range packages { parts := strings.Split(pkg, "@") if len(parts) != 2 { @@ -64,7 +64,7 @@ var rootCmd = &cobra.Command{ } if len(rootFlags.replaces) != 0 { - replaces := strings.Split(rootFlags.replaces, " ") + replaces := strings.Fields(rootFlags.replaces) for i, replace := range replaces { parts := strings.Split(replace, "=") if len(parts) != 2 {