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

Utility method for getting unprivileged account name #3

@aral

Description

@aral

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
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions