quest-sidenoder icon indicating copy to clipboard operation
quest-sidenoder copied to clipboard

Set `sidenoderHome` to `userData`, instead of user's home

Open HeavenVolkoff opened this issue 3 years ago • 1 comments

Hello,

Currently sidenoder stores it's data in the user's home, this make it cluttered and may clash with other applications.

A cleaner approach would be to use Electron's app.getPath('userData') that uses each supported OSes specific per-application data directory

Relevant code: https://github.com/vKolerts/quest-sidenoder/blob/2d84b1339ada40b48117ed55d58fa75714ac0860/main.js#L22

To not break sidenoder for current users, it could first check if the sidenoder directory exists in user's home, and use that if it is the case. Something along the lines of:

global.sidenoderHome = path.join(global.homedir, 'sidenoder').replace(/\\/g, '/');
if (!fs.existsSync(global.sidenoderHome))
	global.sidenoderHome = app.getPath('userData')

To Reproduce Steps to reproduce the behavior:

  1. Open sidenoder
  2. sidenoder data directory is created at user home

Expected behavior Sidenoder creates it's data directory in each supported OSes specific per-application data directory

Desktop:

  • OS: Tested on Windows and Linux (ArchLinux)
  • Binary: .exe and .appimage
  • Version: 0.7.3

HeavenVolkoff avatar Nov 25 '21 19:11 HeavenVolkoff

Thanks, I will think about this. Maybe will make it optional for customize path of home dir

vKolerts avatar Dec 01 '21 12:12 vKolerts