From 9de573c558a3a1be2b64a7c48733f2253aebf783 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 23 Nov 2022 13:33:13 -0500 Subject: [PATCH] fix lack of colors in drone exec output --- drone/exec/exec.go | 4 ++++ drone/exec/flags.go | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drone/exec/exec.go b/drone/exec/exec.go index 6ff4915..b40b8ee 100644 --- a/drone/exec/exec.go +++ b/drone/exec/exec.go @@ -70,6 +70,10 @@ var Command = cli.Command{ Name: "trusted", Usage: "build is trusted", }, + cli.BoolTFlag{ + Name: "pretty", + Usage: "enable pretty printing", + }, cli.DurationFlag{ Name: "timeout", Usage: "build timeout", diff --git a/drone/exec/flags.go b/drone/exec/flags.go index 4c56f9f..344a1ac 100644 --- a/drone/exec/flags.go +++ b/drone/exec/flags.go @@ -47,12 +47,12 @@ type execCommand struct { PrivateKey string } -func mapOldToExecCommand(input *cli.Context) (returnVal *execCommand) { +func mapOldToExecCommand(input *cli.Context) *execCommand { pipelineFile := input.Args().First() if pipelineFile == "" { pipelineFile = ".drone.yml" } - returnVal = &execCommand{ + return &execCommand{ Flags: &Flags{ Build: &drone.Build{ Event: input.String("event"), @@ -88,9 +88,8 @@ func mapOldToExecCommand(input *cli.Context) (returnVal *execCommand) { Secrets: readParams(input.String("secrets")), Config: input.String("registry"), Privileged: input.StringSlice("privileged"), + Pretty: input.BoolT("pretty"), } - - return returnVal } // WithVolumeSlice is a transform function that adds a set of global volumes to the container that are defined in --volume=host:container format.