mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-01 05:36:19 +01:00
add post update
This commit is contained in:
parent
795dad7861
commit
f620f23c35
1 changed files with 12 additions and 1 deletions
|
@ -223,7 +223,18 @@ func initRepository(f string, user *User, repo *Repository, initReadme bool, rep
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
pu, err := os.OpenFile(filepath.Join(f, "hooks", "post-update"), os.O_CREATE|os.O_WRONLY, 0777)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer pu.Close()
|
||||||
|
ep, err := exePath()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
_, err = pu.WriteString(fmt.Sprintf("#!/usr/bin/env bash\n%s update\n", ep))
|
||||||
|
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetRepositoryByName(user *User, repoName string) (*Repository, error) {
|
func GetRepositoryByName(user *User, repoName string) (*Repository, error) {
|
||||||
|
|
Loading…
Reference in a new issue