grim/hgkeeper

closing merged branch
styling
2019-04-18, Gary Kramlich
110f88f716e7
Parents efe6a1c9fd8a
Children
closing merged branch
--- a/setup/command.go Wed Apr 17 23:56:05 2019 -0300
+++ b/setup/command.go Thu Apr 18 15:43:07 2019 -0500
@@ -25,6 +25,19 @@
changegroup.aaac = hg purge --all > /dev/null
changegroup.aaad = hgkeeper refresh-auth
`
+ accessYaml = `---
+global:
+ init:
+ - admins
+ read:
+ - public
+groups:
+ admins:
+patterns:
+ hgkeeper:
+ read:
+ - admins
+`
)
func (c *SetupCommand) Run(reposPath string) error {
@@ -68,6 +81,11 @@
}
hgrcPath := filepath.Join(c.adminRepoPath, ".hg", "hgrc")
+ err = ioutil.WriteFile(hgrcPath, []byte(hgrc), 0644)
+ if err != nil {
+ return err
+ }
- return ioutil.WriteFile(hgrcPath, []byte(hgrc), 0644)
+ accessYamlPath := filepath.Join(c.adminRepoPath, "access.yaml")
+ return ioutil.WriteFile(accessYamlPath, []byte(accessYaml), 0644)
}