Skip to content

Commit

Permalink
Only append some parameters if they are set
Browse files Browse the repository at this point in the history
  • Loading branch information
Roemer committed Aug 17, 2023
1 parent 303d812 commit f9c826f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gttools/mvn.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ type MvnRunSettings struct {
func (tool *MvnTool) Run(settings MvnRunSettings) error {
args := []string{}
args = append(args, settings.Phases...)
args = append(args, "--projects", strings.Join(settings.Projects, ","))
args = append(args, "--activate-profiles", strings.Join(settings.ActivateProfiles, ","))
args = goext.AppendIf(args, len(settings.Projects) > 0, "--projects", strings.Join(settings.Projects, ","))
args = goext.AppendIf(args, len(settings.ActivateProfiles) > 0, "--activate-profiles", strings.Join(settings.ActivateProfiles, ","))
args = goext.AppendIf(args, settings.AlsoMake, "--also-make")
args = goext.AppendIf(args, settings.BatchMode, "--batch-mode")
args = goext.AppendIf(args, settings.Debug, "--debug")
Expand Down

0 comments on commit f9c826f

Please sign in to comment.