]> source.dussan.org Git - gitea.git/commitdiff
Creates hooks directory when init update hook
authorUnknwon <u@gogs.io>
Fri, 14 Aug 2015 17:13:23 +0000 (01:13 +0800)
committerUnknwon <u@gogs.io>
Fri, 14 Aug 2015 17:13:23 +0000 (01:13 +0800)
README.md
models/repo.go

index 3703fdb1d72dc70559137b60c0016452bccbf647..96f67d6a57ce7626c8187ee645450fd3909a0541 100644 (file)
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ Gogs (Go Git Service) is a painless self-hosted Git service.
 
 ![Demo](http://gogs.qiniudn.com/gogs_demo.gif)
 
-##### Current version: 0.6.4 Beta
+##### Current version: 0.6.5 Beta
 
 ### NOTICES
 
index bad6f386800b4bdefc344513dd75f8fe75dbb9c3..9aed7d7d334077beb149d5b0f66f4be134db9775 100644 (file)
@@ -458,7 +458,9 @@ func initRepoCommit(tmpPath string, sig *git.Signature) (err 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)
 }