# Squashed 3 commits
- main3 - test2 - test1
This commit is contained in:
11
git/cmd.go
11
git/cmd.go
@@ -1,10 +1,16 @@
|
||||
package git
|
||||
|
||||
import "os/exec"
|
||||
import (
|
||||
"log"
|
||||
"os/exec"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// Execute runs a git command and returns the stdout
|
||||
func (g *Git) Execute(args ...string) (string, error) {
|
||||
|
||||
log.Println("git", strings.Join(args, " "))
|
||||
|
||||
cmd := exec.Command("git", args...)
|
||||
if g.WorkingDir != "" {
|
||||
cmd.Dir = g.WorkingDir
|
||||
@@ -15,5 +21,6 @@ func (g *Git) Execute(args ...string) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return string(out), nil
|
||||
|
||||
return strings.TrimSuffix(string(out), "\n"), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user