mirror of https://github.com/knative/func.git
fix: return fs errors on config creation
This commit is contained in:
parent
6fdbb649ba
commit
adcd93d70c
|
@ -29,9 +29,12 @@ type config struct {
|
||||||
// empty value of Config.
|
// empty value of Config.
|
||||||
func newConfig(root string) (c config, err error) {
|
func newConfig(root string) (c config, err error) {
|
||||||
filename := filepath.Join(root, ConfigFile)
|
filename := filepath.Join(root, ConfigFile)
|
||||||
if _, err = os.Stat(filename); os.IsNotExist(err) {
|
if _, err = os.Stat(filename); err != nil {
|
||||||
err = nil // do not consider a missing config file an error
|
// do not consider a missing config file an error. Just return.
|
||||||
return // return the zero value of the config
|
if os.IsNotExist(err) {
|
||||||
|
err = nil
|
||||||
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
bb, err := ioutil.ReadFile(filename)
|
bb, err := ioutil.ReadFile(filename)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue