Skip to content

Commit

Permalink
Changes maven debug argument type
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanmaBM committed Nov 18, 2024
1 parent 2697bab commit a2b488e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/openrewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type openRewriteCommand struct {
log logr.Logger
cleanup bool
mavenSettingsFile string
mavenDebugLog string
mavenDebugLog bool
}

func NewOpenRewriteCommand(log logr.Logger) *cobra.Command {
Expand Down Expand Up @@ -62,7 +62,7 @@ func NewOpenRewriteCommand(log logr.Logger) *cobra.Command {
openRewriteCommand.Flags().StringVarP(&openRewriteCmd.goal, "goal", "g", "dryRun", "target goal")
openRewriteCommand.Flags().StringVarP(&openRewriteCmd.input, "input", "i", "", "path to application source code directory")
openRewriteCommand.Flags().StringVarP(&openRewriteCmd.mavenSettingsFile, "maven-settings", "s", "", "path to a custom maven settings file to use")
openRewriteCommand.Flags().StringVarP(&openRewriteCmd.mavenDebugLog, "maven debug log level", "x", "", "set maven log to debug")
openRewriteCommand.Flags().BoolVarP(&openRewriteCmd.mavenDebugLog, "maven debug log level", "x", false, "enable Maven debug logging")

return openRewriteCommand
}
Expand Down Expand Up @@ -153,9 +153,9 @@ func (o *openRewriteCommand) Run(ctx context.Context) error {
o.log.Info("using custom maven settings file", "path", o.mavenSettingsFile)
args = append(args, "-s", o.mavenSettingsFile)
}
if o.mavenDebugLog != "" {
if o.mavenDebugLog {
o.log.Info("Setting Maven log to debug")
args = append(args, "-x")
args = append(args, "-X")
}

err := container.NewContainer().Run(
Expand Down

0 comments on commit a2b488e

Please sign in to comment.