mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-05 01:51:19 +02:00
Fix readdir regression while merging (#2061)
Ref https://github.com/roboll/helmfile/pull/2058#issuecomment-1019439394
This commit is contained in:
@@ -133,13 +133,16 @@ func (c *Context) ReadFile(filename string) (string, error) {
|
||||
}
|
||||
|
||||
func (c *Context) ReadDir(path string) ([]string, error) {
|
||||
if !filepath.IsAbs(path) {
|
||||
path = filepath.Join(c.basePath, path)
|
||||
var contextPath string
|
||||
if filepath.IsAbs(path) {
|
||||
contextPath = path
|
||||
} else {
|
||||
contextPath = filepath.Join(c.basePath, path)
|
||||
}
|
||||
|
||||
entries, err := os.ReadDir(path)
|
||||
entries, err := os.ReadDir(contextPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("ReadDir %q: %w", path, err)
|
||||
return nil, fmt.Errorf("ReadDir %q: %w", contextPath, err)
|
||||
}
|
||||
|
||||
var filenames []string
|
||||
|
||||
Reference in New Issue
Block a user