cointop-sh / cointop

A fast and lightweight interactive terminal based UI application for tracking cryptocurrencies 🚀
https://cointop.sh
Apache License 2.0
3.98k stars 311 forks source link

Use platform TempDir not /tmp #179

Closed lyricnz closed 2 years ago

lyricnz commented 2 years ago

That's what TempDir is for - https://pkg.go.dev/os#TempDir

(maybe a cointop subdirectory)

Yes, might make it a bit harder to tell users where to look.

See #172 for example

lyricnz commented 2 years ago

/tmp is used for two things:

  1. location of cointop.log in debug mode - should be configurable and emitted on console
  2. location of cache - configurable and should default to os.UserCacheDir() + "/cointop"

There is already support for using some tokens in configured paths - in particular :PREFERRED_CACHE_HOME: = os.UserCacheDir() see https://pkg.go.dev/os#UserCacheDir

lyricnz commented 2 years ago

Moved default cache directory to system-specific one in #197

Still need to decide what to do with the log file.