diff options
author | Unknwon <u@gogs.io> | 2015-08-15 01:13:23 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-15 01:13:23 +0800 |
commit | e4d6b5d488981d78417e9c85eda8226ebb8b7e37 (patch) | |
tree | 95cb65f40717f8ccca82680c6c0109f8cab91c2e /models/repo.go | |
parent | 13a74c3a0c946fc844ce9287fd87f2d91aab48d9 (diff) | |
download | gitea-e4d6b5d488981d78417e9c85eda8226ebb8b7e37.tar.gz gitea-e4d6b5d488981d78417e9c85eda8226ebb8b7e37.zip |
Creates hooks directory when init update hook
Diffstat (limited to 'models/repo.go')
-rw-r--r-- | models/repo.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go index bad6f38680..9aed7d7d33 100644 --- a/models/repo.go +++ b/models/repo.go @@ -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) } |