From 00c0b2697c503c6212637cb1285965cccaab73bf Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Sun, 24 Aug 2025 15:06:17 -0700 Subject: [PATCH] Display the error when the plugin command failed to run Which is different from running, and failing. One reason this can happen if the plugin is a shell script without a hash-bang line. Also removed a Debugf() call because there is no way to change the logging level when invoking a plugin. Signed-off-by: Jan Dubois --- cmd/limactl/main.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmd/limactl/main.go b/cmd/limactl/main.go index 77ac6d43760..867d3036652 100644 --- a/cmd/limactl/main.go +++ b/cmd/limactl/main.go @@ -242,16 +242,18 @@ func runExternalPlugin(ctx context.Context, name string, args []string) { return } - logrus.Debugf("found external command: %s", execPath) - cmd := exec.CommandContext(ctx, execPath, args...) cmd.Stdin = os.Stdin cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr cmd.Env = os.Environ() - handleExitCoder(cmd.Run()) - os.Exit(0) //nolint:revive // it's intentional to call os.Exit in this function + err = cmd.Run() + handleExitCoder(err) + if err == nil { + os.Exit(0) //nolint:revive // it's intentional to call os.Exit in this function + } + logrus.Fatalf("external command %q failed: %v", execPath, err) } func updatePathEnv() error {