Skip to content

Commit

Permalink
update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mesuutt committed Jan 7, 2023
1 parent 2ba451e commit c9885f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ func AddHook(path string, hook, content string) error {
hookFilePath := filepath.Join(path, ".git", "hooks", hook)
f, err := os.OpenFile(hookFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, os.ModePerm)
if err != nil {
return fmt.Errorf(hookFilePath+" file could not open for adding hook: %v", err)
return fmt.Errorf("%s file could not open for adding hook: %v", hookFilePath, err)
}

defer f.Close()

if _, err := f.WriteString("\n" + content + "\n"); err != nil {
return fmt.Errorf("hook add failed to post-commit file. error: %v", err)
return fmt.Errorf("hook add failed to %s file. error: %v", hook, err)
}

return nil
Expand Down

0 comments on commit c9885f1

Please sign in to comment.