blob: 4bd51cd2aaf37c93ae95fc1868d23402b2b1dbd7 [file] [log] [blame]
// Copyright 2013 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
package utils
import (
"os/exec"
)
// RunCommand executes the command and return the combined output.
func RunCommand(command string, args ...string) (output string, err error) {
cmd := exec.Command(command, args...)
out, err := cmd.CombinedOutput()
output = string(out)
if err != nil {
return output, err
}
return output, nil
}