From e315fc74ce4b4b41a3b5030a1ec3bd04a0a7a621 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Thu, 7 Sep 2023 16:54:47 +0200 Subject: [PATCH] chore: create `redirect-errors` file if not existent. Signed-off-by: Federico Di Pierro --- cmd/build/build_configs.go | 4 ++-- cmd/cleanup/cleanup_drivers.go | 2 +- cmd/generate/generate_configs.go | 6 +++--- cmd/publish/publish_drivers.go | 2 +- pkg/build/build.go | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/build/build_configs.go b/cmd/build/build_configs.go index 2684290..6f40bab 100644 --- a/cmd/build/build_configs.go +++ b/cmd/build/build_configs.go @@ -18,8 +18,8 @@ func NewBuildConfigsCmd() *cobra.Command { flags.Bool("skip-existing", true, "whether to skip the build of drivers existing on S3") flags.Bool("publish", false, "whether artifacts must be published on S3") flags.Bool("ignore-errors", false, "whether to ignore build errors and go on looping on config files") - flags.String("redirect-errors", "", "redirect error logs to a file") - flags.String("aws-profile", "", "aws-profile to be used. Mandatory if publish is enabled.") + flags.String("redirect-errors", "", "redirect build errors to the specified file") + flags.String("aws-profile", "", "aws-profile to be used. Mandatory if publish is enabled") return cmd } diff --git a/cmd/cleanup/cleanup_drivers.go b/cmd/cleanup/cleanup_drivers.go index b06370f..c4f7eff 100644 --- a/cmd/cleanup/cleanup_drivers.go +++ b/cmd/cleanup/cleanup_drivers.go @@ -15,7 +15,7 @@ func NewCleanupDriversCmd() *cobra.Command { } flags := cmd.Flags() - flags.String("aws-profile", "", "aws-profile to be used. Mandatory.") + flags.String("aws-profile", "", "aws-profile to be used. Mandatory") _ = cmd.MarkFlagRequired("aws-profile") return cmd diff --git a/cmd/generate/generate_configs.go b/cmd/generate/generate_configs.go index c81130b..bd379f4 100644 --- a/cmd/generate/generate_configs.go +++ b/cmd/generate/generate_configs.go @@ -13,11 +13,11 @@ func NewGenerateConfigsCmd() *cobra.Command { Short: "Generate new dbg configs", Long: ` In auto mode, configs will be generated starting from kernel-crawler output. -In this scenario, target-{distro,kernelrelease,kernelversion} are available to filter to-be-generated configs. Regexes are allowed. +In this scenario, --target-{distro,kernelrelease,kernelversion} are available to filter to-be-generated configs. Regexes are allowed. Moreover, you can pass special value "load" as target-distro to make the tool automatically fetch latest distro kernel-crawler ran against. Instead, when auto mode is disabled, the tool is able to generate a single config (for each driver version). -In this scenario, target-{distro,kernelrelease,kernelversion} CANNOT be regexes but must be exact values. -Also, in non-automatic mode, kernelurls driverkit config key will be constructed using driverkit libraries. +In this scenario, --target-{distro,kernelrelease,kernelversion} CANNOT be regexes but must be exact values. +Also, in non-automatic mode, kernelurls will be retrieved using driverkit libraries. `, RunE: executeConfigs, } diff --git a/cmd/publish/publish_drivers.go b/cmd/publish/publish_drivers.go index 1ea797a..c643ee8 100644 --- a/cmd/publish/publish_drivers.go +++ b/cmd/publish/publish_drivers.go @@ -14,7 +14,7 @@ func NewPublishDriversCmd() *cobra.Command { RunE: executeDrivers, } flags := cmd.Flags() - flags.String("aws-profile", "", "aws-profile to be used. Mandatory.") + flags.String("aws-profile", "", "aws-profile to be used. Mandatory") _ = cmd.MarkFlagRequired("aws-profile") return cmd diff --git a/pkg/build/build.go b/pkg/build/build.go index 63cdc5d..35160b1 100644 --- a/pkg/build/build.go +++ b/pkg/build/build.go @@ -35,7 +35,7 @@ func Run(opts Options) error { var redirectErrorsF *os.File if opts.RedirectErrors != "" { - redirectErrorsF, err = os.Open(opts.RedirectErrors) + redirectErrorsF, err = os.OpenFile(opts.RedirectErrors, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644) if err != nil { return err }