Title: | Username, Full Name, Email Address, 'GitHub' Username of the Current User |
---|---|
Description: | Look up the username and full name of the current user, the current user's email address and 'GitHub' username, using various sources of system and configuration information. |
Authors: | Gábor Csárdi [aut, cre], Maëlle Salmon [ctb], Posit Software, PBC [cph, fnd] |
Maintainer: | Gábor Csárdi <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.3.0.9000 |
Built: | 2024-11-05 05:58:25 UTC |
Source: | https://github.com/r-lib/whoami |
If uses the EMAIL
environment variable, if set.
Otherwise it tries to find it in the user's global git configuration.
email_address(fallback = NULL)
email_address(fallback = NULL)
fallback |
If not |
Email address on success. Otherwise an error is thrown.
Other user names:
fullname()
,
gh_username()
,
username()
,
whoami()
## Not run: email_address() ## End(Not run)
## Not run: email_address() ## End(Not run)
Uses the FULLNAME
environment variable, if set.
Otherwise tries system full names and the git configuration as well.
fullname(fallback = NULL)
fullname(fallback = NULL)
fallback |
If not |
The full name of the current user.
Other user names:
email_address()
,
gh_username()
,
username()
,
whoami()
## Not run: fullname() ## End(Not run)
## Not run: fullname() ## End(Not run)
Uses the GITHUB_USERNAME
global variable or searches on GitHub,
for the user's email address, see
email_address
.
gh_username(token = NULL, fallback = NULL)
gh_username(token = NULL, fallback = NULL)
token |
GitHub token to use. By default it uses
the |
fallback |
If not |
This function caches the username in the current R session, and if the email address of the user is unchanged, it does not perform another GitHub query.
GitHub username, or an error is thrown if it cannot be found.
Other user names:
email_address()
,
fullname()
,
username()
,
whoami()
## Not run: gh_username() ## End(Not run)
## Not run: gh_username() ## End(Not run)
Tries the LOGNAME
, USER
, LNAME
, USERNAME
environment variables first. Then it tries the id
command on Unix-like
platforms and whoami
on Windows.
username(fallback = NULL)
username(fallback = NULL)
fallback |
If not |
The user name of the current user.
Other user names:
email_address()
,
fullname()
,
gh_username()
,
whoami()
## Not run: username() ## End(Not run)
## Not run: username() ## End(Not run)
whoami()
whoami()
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.
On Windows, it tries finding the global git configuration
in Sys.getenv("USERPROFILE")
if it doesn't find it
in Sys.getenv("HOME")
(often "Documents").
For the email address it uses the user's global git
configuration. It tries finding the global git
configuration in Sys.getenv("USERPROFILE")
if it doesn't find it in Sys.getenv("HOME")
.
For the GitHub username it uses the GITHUB_USERNAME
environment variable then it tries searching on GitHub
for the user's email address.
A named character vector with entries: username
,
fullname
, email_address
, gh_username
.
Other user names:
email_address()
,
fullname()
,
gh_username()
,
username()
## Not run: whoami() ## End(Not run)
## Not run: whoami() ## End(Not run)