arnaucube
arnaucube/padArchiverPublic Self-hosted repository
padArchiver/git.go
git.goRaw
 1package padArchiver
 2
 3import (
 4	"fmt"
 5	"os/exec"
 6)
 7
 8//GitUpdate updates the git
 9func (repo *Repo) GitUpdate(commitMsg string) error {
10	//TODO this is not finished
11	_, err := exec.Command("bash", "-c", "git pull origin master").Output()
12	if err != nil {
13		fmt.Println(err)
14		return err
15	}
16	_, err = exec.Command("bash", "-c", "git add .").Output()
17	if err != nil {
18		fmt.Println(err)
19		return err
20	}
21	_, err = exec.Command("bash", "-c", "git commit -m '"+commitMsg+"'").Output()
22	if err != nil {
23		fmt.Println(err)
24		return err
25	}
26	return nil
27}