nodekit icon indicating copy to clipboard operation
nodekit copied to clipboard

Utility method for getting unprivileged home directory

Open aral opened this issue 4 years ago • 0 comments

From: lib/Util.js:

static unprivilegedHomeDirectory () {
  if (process.platform === 'win32') {
    return os.homedir()
  } else {
    // Linuxesque: return non-root home folder even if invoked via sudo.
    const accountsFolder = os.platform() === 'darwin' ? 'Users' : 'home'
    return `/${accountsFolder}/${Util.unprivilegedAccountName()}`
  }
}

aral avatar Aug 05 '21 14:08 aral