From 67a446234c678fe56f1c209b8b75d511cc2d1d94 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Thu, 21 Nov 2019 21:45:18 +1100 Subject: fix specs --- pkg/commands/os.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pkg/commands/os.go') diff --git a/pkg/commands/os.go b/pkg/commands/os.go index 8f49483c6..e421c4e6a 100644 --- a/pkg/commands/os.go +++ b/pkg/commands/os.go @@ -59,9 +59,11 @@ func (c *OSCommand) SetCommand(cmd func(string, ...string) *exec.Cmd) { } // RunCommandWithOutput wrapper around commands returning their output and error +// NOTE: because this takes a format string followed by format args, you'll need +// to escape any percentage signs via '%%'. func (c *OSCommand) RunCommandWithOutput(formatString string, formatArgs ...interface{}) (string, error) { command := formatString - if len(formatArgs) > 0 { + if formatArgs != nil { command = fmt.Sprintf(formatString, formatArgs...) } c.Log.WithField("command", command).Info("RunCommand") -- cgit v1.2.3