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 account name #3

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

Utility method for getting unprivileged account name #3

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 unprivilegedAccountName () {
  if (process.platform === 'win32' || process.env.USER !== 'root') {
    // Does not apply to Windows as there is no sudo.
    return os.userInfo().username
  } else {
    return process.env.SUDO_USER
  }
}
@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