Skip to content

Commit

Permalink
fix: 兼容supervisor环境下启动报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
yryz committed Jul 25, 2019
1 parent 8e9364e commit b0b61a6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ func init() {
log.SetFormatter(&log.TextFormatter{FullTimestamp: true})

usr, err := user.Current()
if err != nil {
panic(err)
if err == nil {
configFile = usr.HomeDir + "/.httpproxy/config.json"
}
configFile = usr.HomeDir + "/.httpproxy/config.json"

flag.StringVar(&configFile, "c", configFile, "configuration file path")
flag.Parse()
Expand Down

0 comments on commit b0b61a6

Please sign in to comment.