Commit 39293933 by Iwasaki Yudai

Show error when failed to get current user

1 parent 45f65bfc
Showing with 4 additions and 1 deletions
...@@ -53,7 +53,10 @@ func New(options Options) (*App, error) { ...@@ -53,7 +53,10 @@ func New(options Options) (*App, error) {
prefString := []byte{} prefString := []byte{}
prefPath := options.ProfileFile prefPath := options.ProfileFile
if options.ProfileFile == DefaultProfileFilePath { if options.ProfileFile == DefaultProfileFilePath {
usr, _ := user.Current() usr, err := user.Current()
if err != nil {
return nil, err
}
prefPath = usr.HomeDir + "/.gotty" prefPath = usr.HomeDir + "/.gotty"
} }
if _, err = os.Stat(prefPath); os.IsNotExist(err) { if _, err = os.Stat(prefPath); os.IsNotExist(err) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!