diff --git a/file.go b/file.go index cbb4c33..2f47c30 100644 --- a/file.go +++ b/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) { cmd := exec.Command("git", "add", ".") 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.Dir = fp.dirname - cmd.Run() + err = cmd.Run() + if err != nil { + log.Println(err) + return + } } func (fp *FilePages) Exist(p string) bool {