MCPcopy Index your code
hub / github.com/conventionalcommit/commitlint / writeHooks

Function writeHooks

internal/cmd/hook.go:48–63  ·  view source on GitHub ↗
(hookDir string, isReplace bool)

Source from the content-addressed store, hash-verified

46}
47
48func writeHooks(hookDir string, isReplace bool) error {
49 // if commit-msg already exists skip creating or overwriting it
50 if _, err := os.Stat(hookDir); !os.IsNotExist(err) {
51 if !isReplace {
52 return errHooksExist
53 }
54 }
55
56 err := os.MkdirAll(hookDir, os.ModePerm)
57 if err != nil {
58 return err
59 }
60
61 // create hook file
62 return hook.WriteHooks(hookDir)
63}
64
65func getHookDir(hookFlag string, isGlobal bool) (string, error) {
66 if hookFlag != "" {

Callers 2

initHooksFunction · 0.85
createHooksFunction · 0.85

Calls 1

WriteHooksFunction · 0.92

Tested by

no test coverage detected