mirror of
https://github.com/onyx-and-iris/gignore.git
synced 2025-04-01 19:23:51 +01:00
rename registry functions
This commit is contained in:
parent
f0b64e3a75
commit
c2b7dfcb18
@ -32,7 +32,7 @@ func New(options ...Option) *Client {
|
||||
|
||||
// List returns a list of available .gitignore templates.
|
||||
func (c *Client) List() ([]string, error) {
|
||||
return c.registry.ListTemplates()
|
||||
return c.registry.List()
|
||||
}
|
||||
|
||||
// Create generates a .gitignore file from the specified template.
|
||||
@ -60,7 +60,7 @@ func (c *Client) Create(template string) error {
|
||||
log.Infof("template '%s' found in default gitignoreio registry", template)
|
||||
}
|
||||
|
||||
content, err := c.registry.GetTemplate(template)
|
||||
content, err := c.registry.Get(template)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -41,8 +41,8 @@ func (t *TemplateRegistry) Contains(name string) (bool, error) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
// GetTemplate retrieves the content of the gitignore template with the given name.
|
||||
func (t *TemplateRegistry) GetTemplate(name string) ([]byte, error) {
|
||||
// Get retrieves the content of the gitignore template with the given name.
|
||||
func (t *TemplateRegistry) Get(name string) ([]byte, error) {
|
||||
data, err := fs.ReadFile(t.templates, t.filePath(name))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -50,8 +50,8 @@ func (t *TemplateRegistry) GetTemplate(name string) ([]byte, error) {
|
||||
return data, nil
|
||||
}
|
||||
|
||||
// ListTemplates lists all the gitignore templates in the registry.
|
||||
func (t *TemplateRegistry) ListTemplates() ([]string, error) {
|
||||
// List lists all the gitignore templates in the registry.
|
||||
func (t *TemplateRegistry) List() ([]string, error) {
|
||||
var paths []string
|
||||
|
||||
err := fs.WalkDir(
|
||||
|
Loading…
x
Reference in New Issue
Block a user