fix nil ptr config #40
This commit is contained in:
parent
cbb4165766
commit
28b2e14b51
|
@ -240,9 +240,6 @@ func New(config *pomo.Config) *cli.Cli {
|
||||||
path = app.StringOpt("p path", defaultConfigPath(), "path to the pomo config directory")
|
path = app.StringOpt("p path", defaultConfigPath(), "path to the pomo config directory")
|
||||||
)
|
)
|
||||||
app.Before = func() {
|
app.Before = func() {
|
||||||
if config == nil {
|
|
||||||
config = &pomo.Config{}
|
|
||||||
}
|
|
||||||
maybe(pomo.LoadConfig(*path, config))
|
maybe(pomo.LoadConfig(*path, config))
|
||||||
}
|
}
|
||||||
app.Version("v version", pomo.Version)
|
app.Version("v version", pomo.Version)
|
||||||
|
@ -257,4 +254,4 @@ func New(config *pomo.Config) *cli.Cli {
|
||||||
return app
|
return app
|
||||||
}
|
}
|
||||||
|
|
||||||
func Run() { New(nil).Run(os.Args) }
|
func Run() { New(&pomo.Config{}).Run(os.Args) }
|
||||||
|
|
Loading…
Reference in New Issue