Fix readdir regression while merging (#2061)
Ref https://github.com/roboll/helmfile/pull/2058#issuecomment-1019439394
This commit is contained in:
parent
1d70130ab9
commit
061644c5d0
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue