blob: 4bd51cd2aaf37c93ae95fc1868d23402b2b1dbd7 [file] [log] [blame]
David K. Bainbridge528b3182017-01-23 08:51:59 -08001// Copyright 2013 Canonical Ltd.
2// Licensed under the LGPLv3, see LICENCE file for details.
3
4package utils
5
6import (
7 "os/exec"
8)
9
10// RunCommand executes the command and return the combined output.
11func RunCommand(command string, args ...string) (output string, err error) {
12 cmd := exec.Command(command, args...)
13 out, err := cmd.CombinedOutput()
14 output = string(out)
15 if err != nil {
16 return output, err
17 }
18 return output, nil
19}