Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Utility method for getting unprivileged home directory #2

Open
aral opened this issue Aug 5, 2021 · 0 comments
Open

Utility method for getting unprivileged home directory #2

aral opened this issue Aug 5, 2021 · 0 comments
Labels
enhancement New feature or request Port (Site.js) Port feature from Site.js

Comments

@aral
Copy link
Contributor

aral commented Aug 5, 2021

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 aral added enhancement New feature or request Port (Site.js) Port feature from Site.js labels Aug 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request Port (Site.js) Port feature from Site.js
Projects
None yet
Development

No branches or pull requests

1 participant