Skip to content

Commit

Permalink
chore: allow passing replaces or packages (#20)
Browse files Browse the repository at this point in the history
* allow passing replaces or packages

Signed-off-by: hectorj2f <[email protected]>

* Update cmd/gobump/root.go

Co-authored-by: Dan Luhring <[email protected]>
Signed-off-by: Hector Fernandez <[email protected]>

---------

Signed-off-by: hectorj2f <[email protected]>
Signed-off-by: Hector Fernandez <[email protected]>
Co-authored-by: Dan Luhring <[email protected]>
  • Loading branch information
hectorj2f and luhring authored Jan 18, 2024
1 parent 676636f commit 9420c5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/gobump/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ var rootCmd = &cobra.Command{
// Uncomment the following line if your bare application
// has an action associated with it:
RunE: func(cmd *cobra.Command, args []string) error {
if rootFlags.packages == "" {
return fmt.Errorf("Error: No packages provided. Usage: gobump --packages=\"<package1@version> <package2@version> ...\"")
if rootFlags.packages == "" && rootFlags.replaces == "" {
return fmt.Errorf("Error: No packages or replaces provided. Usage: gobump --packages=\"<package1@version> <package2@version> ...\" --replaces=\"<package3=package4@version> ...\"")
}
packages := strings.Split(rootFlags.packages, " ")
pkgVersions := map[string]*types.Package{}
Expand Down

0 comments on commit 9420c5c

Please sign in to comment.