I'm currently building a electron app an building the installer like .deb
and .snap
with electron-builder. Inside the app I need the access the user home directory for some reason and I'm using process.env.HOME || process.env.USERPROFILE
to get the home directory (also app.getPath('home')
returns the same). This works properly for other cases but when the app installed with .snap
, instead of the actual home(/home/username
) directory this returns ~/snap/<app_name>/3/
as home directory. (3
is the snap revision number)
How do I get the actual home directory(/home/username
) in all cases ?