Skip to content

Commit

Permalink
NewConfig now returns an error if no config file is found
Browse files Browse the repository at this point in the history
  • Loading branch information
wpueschel committed Mar 16, 2018
1 parent 325c9e0 commit 8adaa65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (c *Config) readFile(fname string) error {
return nil
}

// Function NewGiteaConf creates and returns a new gitea config object
// Function NewConfig creates and returns a new gitea config object
func NewConfig() (*Config, error) {

c := new(Config)
Expand All @@ -103,6 +103,9 @@ func NewConfig() (*Config, error) {

return &Config{}, err
}
} else {
log.Fatalf("Could not read config file %s: %s", c.configfile, err)
return &Config{}, err
}

// if -N is set, we dont need a repo name and make the current directory name the reponame
Expand Down

0 comments on commit 8adaa65

Please sign in to comment.