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 home directory #2

@aral

Description

@aral

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()}`
  }
}

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