MCPcopy Create free account
hub / github.com/belak/gitdir / ensureAdminUser

Method ensureAdminUser

config_admin.go:20–24  ·  view source on GitHub ↗
(repo *git.Repository, user string, pubKey *models.PublicKey)

Source from the content-addressed store, hash-verified

18}
19
20func (c *Config) ensureAdminUser(repo *git.Repository, user string, pubKey *models.PublicKey) error {
21 return repo.UpdateFile("config.yml", func(data []byte) ([]byte, error) {
22 return ensureAdminUser(data, user, pubKey.MarshalAuthorizedKey())
23 })
24}
25
26func (c *Config) ensureAdminEd25519Key(repo *git.Repository) error {
27 return repo.UpdateFile("ssh/id_ed25519", func(data []byte) ([]byte, error) {

Callers 1

EnsureAdminUserMethod · 0.95

Calls 3

ensureAdminUserFunction · 0.85
UpdateFileMethod · 0.80
MarshalAuthorizedKeyMethod · 0.80

Tested by

no test coverage detected