From bd568e618911ee393e71281796363d9040e8c27a Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Sun, 24 Nov 2024 20:41:54 +1100 Subject: [PATCH] Update v3/internal/commands/tool_package.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- v3/internal/commands/tool_package.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/v3/internal/commands/tool_package.go b/v3/internal/commands/tool_package.go index 8e7718882b4..c631352a501 100644 --- a/v3/internal/commands/tool_package.go +++ b/v3/internal/commands/tool_package.go @@ -42,8 +42,10 @@ func ToolPackage(options *flags.ToolPackage) error { } // Check if config file exists - if _, err := os.Stat(configPath); err != nil { + if info, err := os.Stat(configPath); err != nil { return fmt.Errorf("config file not found: %s", configPath) + } else if info.Mode().Perm()&0444 == 0 { + return fmt.Errorf("config file is not readable: %s", configPath) } // Generate output filename based on format