From e62482c56fdd62d6b7a39b894e999c39005734a0 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Sat, 19 Feb 2022 14:35:57 +0100 Subject: [PATCH] fix(cmd): return empty on error resolves #1783 --- src/environment/shell.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/environment/shell.go b/src/environment/shell.go index 8c3eea59..29776017 100644 --- a/src/environment/shell.go +++ b/src/environment/shell.go @@ -429,8 +429,10 @@ func (env *ShellEnvironment) RunCommand(command string, args ...string) (string, func (env *ShellEnvironment) RunShellCommand(shell, command string) string { defer env.trace(time.Now(), "RunShellCommand", shell, command) - out, _ := env.RunCommand(shell, "-c", command) - return out + if out, err := env.RunCommand(shell, "-c", command); err == nil { + return out + } + return "" } func (env *ShellEnvironment) HasCommand(command string) bool {