Skip to content

Commit

Permalink
feat: lot to user cache (#165)
Browse files Browse the repository at this point in the history
closes #161

Signed-off-by: Carlos A Becker <[email protected]>
  • Loading branch information
caarlos0 authored Mar 21, 2023
1 parent da4a026 commit 059ce87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/wishlist/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ It's also possible to serve the TUI over SSH using the server command.
HiddenDefaultCmd: true,
},
RunE: func(cmd *cobra.Command, args []string) error {
f, err := os.OpenFile("wishlist.log", os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) //nolint:gomnd
cache, err := os.UserCacheDir()
if err != nil {
return fmt.Errorf("could not create log file: %w", err)
}
f, err := os.OpenFile(filepath.Join(cache, "wishlist.log"), os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) //nolint:gomnd
if err != nil {
return err //nolint: wrapcheck
}
Expand Down

0 comments on commit 059ce87

Please sign in to comment.