mirror of
https://github.com/helm/helm.git
synced 2026-05-28 04:35:48 -04:00
Merge pull request #10574 from Juneezee/refactor/os.ReadDir
refactor: use `os.ReadDir` for lightweight directory reading
This commit is contained in:
commit
21952fccc4
1 changed files with 3 additions and 3 deletions
|
|
@ -400,12 +400,12 @@ func parseOCIRef(chartRef string) (string, string, error) {
|
|||
func (m *Manager) safeMoveDeps(deps []*chart.Dependency, source, dest string) error {
|
||||
existsInSourceDirectory := map[string]bool{}
|
||||
isLocalDependency := map[string]bool{}
|
||||
sourceFiles, err := ioutil.ReadDir(source)
|
||||
sourceFiles, err := os.ReadDir(source)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// attempt to read destFiles; fail fast if we can't
|
||||
destFiles, err := ioutil.ReadDir(dest)
|
||||
destFiles, err := os.ReadDir(dest)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -436,7 +436,7 @@ func (m *Manager) safeMoveDeps(deps []*chart.Dependency, source, dest string) er
|
|||
}
|
||||
|
||||
fmt.Fprintln(m.Out, "Deleting outdated charts")
|
||||
// find all files that exist in dest that do not exist in source; delete them (outdated dependendencies)
|
||||
// find all files that exist in dest that do not exist in source; delete them (outdated dependencies)
|
||||
for _, file := range destFiles {
|
||||
if !file.IsDir() && !existsInSourceDirectory[file.Name()] {
|
||||
fname := filepath.Join(dest, file.Name())
|
||||
|
|
|
|||
Loading…
Reference in a new issue