MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / installHook

Method installHook

tools/mage/git.go:34–46  ·  view source on GitHub ↗
(name string)

Source from the content-addressed store, hash-verified

32type Git mg.Namespace
33
34func (Git) installHook(name string) (err error) {
35 if mg.Verbose() {
36 fmt.Printf("Installing %s hook\n", name)
37 }
38 return os.WriteFile(
39 filepath.Join(".git", "hooks", name),
40 []byte(fmt.Sprintf(
41 `STDIN="$(cat /dev/stdin)" ARGS="$@" make git.%s`,
42 name,
43 )),
44 0o755,
45 )
46}
47
48var gitHooks = []string{"pre-commit", "commit-msg", "pre-push"}
49

Callers 1

InstallHooksMethod · 0.95

Calls 3

WriteFileMethod · 0.80
JoinMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected