Add error logging to git add and commit
This commit is contained in:
parent
c67aa6ed4f
commit
f70d1ccc05
12
file.go
12
file.go
|
@ -52,11 +52,19 @@ func (fp *FilePages) Save(p string, page Page, summary, author string) {
|
||||||
func saveWithGit(fp *FilePages, p string, summary, author string) {
|
func saveWithGit(fp *FilePages, p string, summary, author string) {
|
||||||
cmd := exec.Command("git", "add", ".")
|
cmd := exec.Command("git", "add", ".")
|
||||||
cmd.Dir = fp.dirname
|
cmd.Dir = fp.dirname
|
||||||
cmd.Run()
|
err := cmd.Run()
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
cmd = exec.Command("git", "commit", "-m", "Changes to "+p+" by "+author+"\n\n"+summary)
|
cmd = exec.Command("git", "commit", "-m", "Changes to "+p+" by "+author+"\n\n"+summary)
|
||||||
cmd.Dir = fp.dirname
|
cmd.Dir = fp.dirname
|
||||||
cmd.Run()
|
err = cmd.Run()
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fp *FilePages) Exist(p string) bool {
|
func (fp *FilePages) Exist(p string) bool {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user