mirror of https://github.com/helm/helm.git
check the error that WriteFile returns
This commit is contained in:
parent
e3f39f30bf
commit
8a1d43ec3f
|
@ -190,7 +190,9 @@ func ensureDefaultRepos(home helmpath.Home, out io.Writer) error {
|
|||
}
|
||||
f.Add(sr)
|
||||
f.Add(lr)
|
||||
f.WriteFile(repoFile, 0644)
|
||||
if err := f.WriteFile(repoFile, 0644); err != nil {
|
||||
return err
|
||||
}
|
||||
} else if fi.IsDir() {
|
||||
return fmt.Errorf("%s must be a file, not a directory", repoFile)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue