mirror of
https://github.com/go-gitea/gitea.git
synced 2024-09-06 23:44:20 -04:00
Creates hooks directory when init update hook
This commit is contained in:
parent
13a74c3a0c
commit
e4d6b5d488
@ -7,7 +7,7 @@ Gogs (Go Git Service) is a painless self-hosted Git service.
|
|||||||
|
|
||||||
![Demo](http://gogs.qiniudn.com/gogs_demo.gif)
|
![Demo](http://gogs.qiniudn.com/gogs_demo.gif)
|
||||||
|
|
||||||
##### Current version: 0.6.4 Beta
|
##### Current version: 0.6.5 Beta
|
||||||
|
|
||||||
### NOTICES
|
### NOTICES
|
||||||
|
|
||||||
|
@ -458,7 +458,9 @@ func initRepoCommit(tmpPath string, sig *git.Signature) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createUpdateHook(repoPath string) error {
|
func createUpdateHook(repoPath string) error {
|
||||||
return ioutil.WriteFile(path.Join(repoPath, "hooks/update"),
|
hookPath := path.Join(repoPath, "hooks/update")
|
||||||
|
os.MkdirAll(path.Dir(hookPath), os.ModePerm)
|
||||||
|
return ioutil.WriteFile(hookPath,
|
||||||
[]byte(fmt.Sprintf(_TPL_UPDATE_HOOK, setting.ScriptType, "\""+appPath+"\"", setting.CustomConf)), 0777)
|
[]byte(fmt.Sprintf(_TPL_UPDATE_HOOK, setting.ScriptType, "\""+appPath+"\"", setting.CustomConf)), 0777)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user