MCPcopy Create free account
hub / github.com/dirk/quickhook / shimCommandForHook

Function shimCommandForHook

install.go:141–154  ·  view source on GitHub ↗
(quickhook, hook string)

Source from the content-addressed store, hash-verified

139}
140
141func shimCommandForHook(quickhook, hook string) (string, error) {
142 var args string
143
144 switch hook {
145 case "pre-commit":
146 args = "pre-commit"
147 case "commit-msg":
148 args = "commit-msg $1"
149 default:
150 return "", fmt.Errorf("invalid hook: %v", hook)
151 }
152
153 return fmt.Sprintf("%s hook %s", quickhook, args), nil
154}

Callers 1

installShimFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected