mirror of
https://github.com/yudai/gotty.git
synced 2026-01-01 23:28:49 +01:00
Fix default config file loading
This commit is contained in:
parent
8e90497c31
commit
25a5bc0b89
2 changed files with 8 additions and 6 deletions
6
main.go
6
main.go
|
|
@ -69,7 +69,7 @@ func main() {
|
|||
options := app.DefaultOptions
|
||||
|
||||
configFile := c.String("config")
|
||||
_, err := os.Stat(configFile)
|
||||
_, err := os.Stat(app.ExpandHomeDir(configFile))
|
||||
if configFile != "~/.gotty" || !os.IsNotExist(err) {
|
||||
if err := app.ApplyConfigFile(&options, configFile); err != nil {
|
||||
exit(err, 2)
|
||||
|
|
@ -101,7 +101,9 @@ func main() {
|
|||
}
|
||||
|
||||
func exit(err error, code int) {
|
||||
fmt.Println(err)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
os.Exit(code)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue