Skip to content

Commit

Permalink
feat: x
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzix committed Nov 16, 2021
1 parent 243c72a commit 4aa6fdd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ func init() {
log.SetFlags(log.LstdFlags | log.Lshortfile)
viper.SetConfigFile("config.yml")
if err := viper.ReadInConfig(); err != nil {
if os.IsNotExist(err) {
if args := os.Args; len(args) >= 2 && args[1] == "init" {
return
}
}
log.Fatal("init config before sniper")
}
}

0 comments on commit 4aa6fdd

Please sign in to comment.