-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Link the entry source with the LD file.
- Loading branch information
Showing
4 changed files
with
94 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package spicy | ||
|
||
import ( | ||
"bytes" | ||
"fmt" | ||
"github.com/golang/glog" | ||
"os/exec" | ||
"strings" | ||
) | ||
|
||
func RunCmd(command string, args ...string) error { | ||
fmt.Printf("About to run %s %s\n", command, strings.Join(args, " ")) | ||
cmd := exec.Command(command, args...) | ||
var out bytes.Buffer | ||
var errout bytes.Buffer | ||
cmd.Stdout = &out | ||
cmd.Stderr = &errout | ||
err := cmd.Run() | ||
if glog.V(2) { | ||
glog.V(2).Info(command, " stdout: ", out.String()) | ||
} | ||
if err != nil { | ||
glog.Error("Error running ", command, ". Stderr output: ", errout.String()) | ||
} | ||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters