Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/options/dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,22 +79,22 @@ func WalkLocales(callback func(path, name string, d fs.DirEntry, err error) erro

// Readme reads the content of a specific readme from static or custom path.
func Readme(name string) ([]byte, error) {
return fileFromDir(path.Join("readme", name))
return fileFromDir(path.Join("readme", path.Base(name)))
}

// Gitignore reads the content of a specific gitignore from static or custom path.
func Gitignore(name string) ([]byte, error) {
return fileFromDir(path.Join("gitignore", name))
return fileFromDir(path.Join("gitignore", path.Base(name)))
}

// License reads the content of a specific license from static or custom path.
func License(name string) ([]byte, error) {
return fileFromDir(path.Join("license", name))
return fileFromDir(path.Join("license", path.Base(name)))
}

// Labels reads the content of a specific labels from static or custom path.
func Labels(name string) ([]byte, error) {
return fileFromDir(path.Join("label", name))
return fileFromDir(path.Join("label", path.Base(name)))
}

// fileFromDir is a helper to read files from static or custom path.
Expand Down
8 changes: 4 additions & 4 deletions modules/options/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,22 @@ func WalkLocales(callback func(path, name string, d fs.DirEntry, err error) erro

// Readme reads the content of a specific readme from bindata or custom path.
func Readme(name string) ([]byte, error) {
return fileFromDir(path.Join("readme", name))
return fileFromDir(path.Join("readme", path.Base(name)))
}

// Gitignore reads the content of a gitignore locale from bindata or custom path.
func Gitignore(name string) ([]byte, error) {
return fileFromDir(path.Join("gitignore", name))
return fileFromDir(path.Join("gitignore", path.Base(name)))
}

// License reads the content of a specific license from bindata or custom path.
func License(name string) ([]byte, error) {
return fileFromDir(path.Join("license", name))
return fileFromDir(path.Join("license", path.Base(name)))
}

// Labels reads the content of a specific labels from static or custom path.
func Labels(name string) ([]byte, error) {
return fileFromDir(path.Join("label", name))
return fileFromDir(path.Join("label", path.Base(name)))
}

// fileFromDir is a helper to read files from bindata or custom path.
Expand Down