fix: log useful error message when failed walking through the file tree (#592)

Fixes #590
This commit is contained in:
KUOKA Yusuke 2019-05-14 10:02:50 +09:00 committed by GitHub
parent 255d92064e
commit 53ad91607a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1021,7 +1021,10 @@ func chartNameWithoutRepository(chart string) string {
// find "Chart.yaml" // find "Chart.yaml"
func findChartDirectory(topLevelDir string) (string, error) { func findChartDirectory(topLevelDir string) (string, error) {
var files []string var files []string
filepath.Walk(topLevelDir, func(path string, f os.FileInfo, _ error) error { filepath.Walk(topLevelDir, func(path string, f os.FileInfo, err error) error {
if err != nil {
return fmt.Errorf("error walking through %s: %v", path, err)
}
if !f.IsDir() { if !f.IsDir() {
r, err := regexp.MatchString("Chart.yaml", f.Name()) r, err := regexp.MatchString("Chart.yaml", f.Name())
if err == nil && r { if err == nil && r {