Skip to content

Commit

Permalink
fix doOnce to work even if config file is not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Feb 20, 2016
1 parent 02a4b5d commit 47ee027
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,10 @@ func doRetire(argv []string) int {
}

func doOnce(argv []string) int {
// dirty hack `resolveConfig` required apikey so fill up
argvOpt := append(argv, "-apikey=dummy")
conf, err := resolveConfig(argvOpt)
conf, err := resolveConfig(argv)
if err != nil {
logger.Criticalf("failed to load config: %s", err)
return exitStatusError
logger.Warningf("failed to load config (but `once` must not required conf): %s", err)
conf = &config.Config{}
}
command.RunOnce(conf)
return exitStatusOK
Expand Down

0 comments on commit 47ee027

Please sign in to comment.