Username, full name, email address and GitHub username of the current user
R Makefile
Switch branches/tags
Nothing to show
Clone or download
maelle and gaborcsardi use .gitconfig in USERPROFILE explicitely on Windows when HOME fails (#7
)

* use .gitconfig in USERPROFILE explicitely on Windows when HOME fails

* fix .gitconfig location everywhere for Windows

* small tweak to trigger new Travis build
Latest commit 2d6a98b Jul 11, 2018

README.md

whoami

Linux Build Status Windows Build status CRAN RStudio mirror downloads Coverage Status

Username, full name, email address, GitHub username of the current user

For the username it tries the LOGNAME, USER, LNAME and USERNAME environment variables first. If these are all unset, or set to an empty string, then it tries running id on Unix-like systems and whoami on Windows.

For the full name of the user, it queries the system services and also tries the user's global git configuration.

For the email address it users the user's global git configuration.

For the GitHub usename it searches on GitHub for the user's email address.

Related JavaScript packages: sindresorhus/username, sindresorhus/fullname, sindresorhus/github-username, paulirish/github-email.

Installation

devtools::install_github("r-lib/whoami")

Usage

library(whoami)
username()
#> [1] "gaborcsardi"
fullname()
#> [1] "Gabor Csardi"
email_address()
#> [1] "csardi.gabor@gmail.com"
gh_username()
#> [1] "gaborcsardi"
whoami()
#>                 username                 fullname            email_address 
#>            "gaborcsardi"           "Gabor Csardi" "csardi.gabor@gmail.com" 
#>              gh_username 
#>            "gaborcsardi"

License

MIT © Gábor Csárdi