whoami/0000755000176200001440000000000013444154703011543 5ustar liggesuserswhoami/inst/0000755000176200001440000000000013444153216012516 5ustar liggesuserswhoami/inst/NEWS.md0000644000176200001440000000150013444153216013610 0ustar liggesusers # 1.3.0 * Now `fullname()` uses the `FULLNAME` environment variable, if set. * Now `email_address()` uses the `EMAIL` environment variable, if set. # 1.2.0 * `gh_username()` caches the result, separately for each email address. * `gh_username()` uses the `GITHUB_USERNAME` environment variable, if it it is set (#6, @maelle) * On Windows, `gh_fullname()` and `gh_email_address()` try finding the global git configuration in `Sys.getenv("USERPROFILE")` if it is not found in `Sys.getenv("HOME")` (#7, @maelle) * `gh_username()` also tries the `GITHUB_PAT` environment variable to find a GitHub token, after `GITHUB_TOKEN` (#9, @maelle) # 1.1.2 Maintainence release, no user visible changes # 1.1.1 Maintainence release, no user visible changes # 1.1.0 * Fallbacks, instead of errors, #2 # 1.0.0 First release whoami/inst/README.md0000644000176200001440000000462513442316113013777 0ustar liggesusers # whoami [![Linux Build Status](https://travis-ci.org/r-lib/whoami.svg?branch=master)](https://travis-ci.org/r-lib/whoami) [![Windows Build status](https://ci.appveyor.com/api/projects/status/github/r-lib/whoami?svg=true)](https://ci.appveyor.com/project/gaborcsardi/whoami) [![](http://www.r-pkg.org/badges/version/whoami)](http://www.r-pkg.org/pkg/whoami) [![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/whoami)](http://www.r-pkg.org/pkg/whoami) [![Coverage Status](https://img.shields.io/codecov/c/github/r-lib/whoami/master.svg)](https://codecov.io/github/r-lib/whoami?branch=master) > 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. 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. Related JavaScript packages: [sindresorhus/username](https://github.com/sindresorhus/username), [sindresorhus/fullname](https://github.com/sindresorhus/fullname), [sindresorhus/github-username](https://github.com/sindresorhus/github-username), [paulirish/github-email](https://github.com/paulirish/github-email). ## Installation ```r devtools::install_github("r-lib/whoami") ``` ## Usage ```r library(whoami) username() ``` ``` #> [1] "gaborcsardi" ``` ```r fullname() ``` ``` #> [1] "Gabor Csardi" ``` ```r email_address() ``` ``` #> [1] "csardi.gabor@gmail.com" ``` ```r gh_username() ``` ``` #> [1] "gaborcsardi" ``` ```r whoami() ``` ``` #> username fullname email_address #> "gaborcsardi" "Gabor Csardi" "csardi.gabor@gmail.com" #> gh_username #> "gaborcsardi" ``` ## License MIT © [Gábor Csárdi](http://gaborcsardi.org) whoami/tests/0000755000176200001440000000000013442316114012677 5ustar liggesuserswhoami/tests/testthat.R0000644000176200001440000000007013442316114014657 0ustar liggesuserslibrary(testthat) library(whoami) test_check("whoami") whoami/tests/testthat/0000755000176200001440000000000013444154703014545 5ustar liggesuserswhoami/tests/testthat/test-memoize.R0000644000176200001440000000103113442316114017277 0ustar liggesusers context("memoize") test_that("can memoize", { called <- 0L f <- function(x) called <<- called + 1L f <- memoize_first(f) f("a") f("a") f("a") expect_equal(called, 1L) f("b") f("b") f("a") expect_equal(called, 2L) }) test_that("non-string argument", { called <- 0L f <- function(x) called <<- called + 1L f <- memoize_first(f) f(NULL) f(123) f(letters) expect_equal(called, 3L) f("a") f("a") f("a") expect_equal(called, 4L) f(NULL) f(123) f(letters) expect_equal(called, 7L) }) whoami/tests/testthat/test-fallbacks.R0000644000176200001440000000152313442316114017562 0ustar liggesusers context("Fallbacks") test_that("username() falls back", { mockery::stub(username, "Sys.getenv", NULL) mockery::stub(username, "system", function(...) stop()) expect_equal(username(fallback = "foobar"), "foobar") }) test_that("fullname() falls back", { mockery::stub(fullname, "system", function(...) stop()) expect_equal(fullname(fallback = "Foo Bar"), "Foo Bar") }) test_that("email_address() falls back", { mockery::stub(email_address, "system", function(...) stop()) expect_equal(email_address(fallback = "foo@bar"), "foo@bar") }) test_that("gh_username() falls back", { mockery::stub(gh_username, "email_address", "not an email") expect_equal(gh_username(fallback = "foobar"), "foobar") mockery::stub(gh_username, "email_address", function(...) stop()) expect_equal(gh_username(fallback = "foobar2"), "foobar2") }) whoami/tests/testthat/test-username.R0000644000176200001440000000105613442316114017460 0ustar liggesusers context("Username") test_that("username works", { user <- Sys.getenv('LOGNAME') on.exit(Sys.setenv(LOGNAME = user), add = TRUE) Sys.setenv(LOGNAME = 'jambajoe') expect_equal(username(), 'jambajoe') }) test_that("username fallback works", { LOGNAME <- Sys.getenv("LOGNAME") USER <- Sys.getenv("USER") LNAME <- Sys.getenv("LNAME") USERNAME <- Sys.getenv("USERNAME") on.exit(Sys.setenv(LOGNAME = LOGNAME, USER = USER, LNAME = LNAME, USERNAME = USERNAME), add = TRUE) expect_match(username(), ".*") }) whoami/tests/testthat/test-fullname.R0000644000176200001440000000112613444150302017437 0ustar liggesusers context("Full name") test_that("fullname fallback", { mockery::stub(fullname, "system", function(cmd, ...) { if (grepl("^git config", cmd)) { "Joe Jamba" } else { NULL } }) expect_equal(fullname(), "Joe Jamba") }) test_that("fullname works", { fn <- try(fullname(), silent = TRUE) if (!inherits(fn, "try-error")) { expect_equal(class(fn), "character") expect_equal(length(fn), 1) expect_match(fn, ".*") } }) test_that("FULLNAME env var", { expect_equal( withr::with_envvar(c("FULLNAME" = "Bugs Bunny"), fullname()), "Bugs Bunny") }) whoami/tests/testthat/test-gh-username.R0000644000176200001440000000134513442316114020055 0ustar liggesusers context("GitHub username") test_that("Github username works", { skip_on_cran() tr <- try( silent = TRUE, gh <- httr::GET( "https://api.github.com", httr::add_headers("user-agent" = "https://github.com/r-lib/whoami"), httr::timeout(1.0) ) ) if (inherits(tr, "try-error") || gh$status_code != 200) { skip("No internet, skipping") } mockery::stub(gh_username, "email_address", "csardi.gabor@gmail.com") expect_equal(gh_username(), "gaborcsardi") # when there's an environment variable with_mock( Sys.getenv = function(x){ if(x == "GITHUB_USERNAME"){ "anuser" }else{ Sys.getenv(x) } }, expect_equal(gh_username(), "anuser") ) }) whoami/tests/testthat/test-email.R0000644000176200001440000000051413444150401016723 0ustar liggesusers context("Email address") test_that("Email address works", { mockery::stub(email_address, "system", "jambajoe@joe.joe") expect_equal(email_address(), "jambajoe@joe.joe") }) test_that("EMAIL env var", { expect_equal( withr::with_envvar(c("EMAIL" = "bugs.bunny@acme.com"), email_address()), "bugs.bunny@acme.com") }) whoami/NAMESPACE0000644000176200001440000000045313444150737012767 0ustar liggesusers# Generated by roxygen2: do not edit by hand export(email_address) export(fullname) export(gh_username) export(username) export(whoami) importFrom(httr,GET) importFrom(httr,add_headers) importFrom(httr,content) importFrom(httr,status_code) importFrom(jsonlite,fromJSON) importFrom(utils,URLencode) whoami/R/0000755000176200001440000000000013444150735011745 5ustar liggesuserswhoami/R/whoami.R0000644000176200001440000002317313444150735013362 0ustar liggesusers .onLoad <- function(libname, pkgname) { lookup_gh_username <<- memoize_first(lookup_gh_username) } is_string <- function(x) { is.character(x) && length(x) == 1 && !is.na(x) } memoize_first <- function(fun) { fun cache <- list() dec <- function(arg, ...) { if (!is_string(arg)) return(fun(arg, ...)) if (is.null(cache[[arg]])) cache[[arg]] <<- fun(arg, ...) cache[[arg]] } dec } gh_url <- "https://api.github.com" ok <- function(x) { !inherits(x, "try-error") && !is.null(x) && length(x) == 1 && x != "" && !is.na(x) } `%or%` <- function(l, r) { if (ok(l)) l else r } str_trim <- function(x) { gsub("\\s+$", "", gsub("^\\s+", "", x)) } fallback_or_stop <- function(fallback, msg) { if (!is.null(fallback)) { fallback } else { stop(msg) } } #' User name of the current user #' #' Tries the \code{LOGNAME}, \code{USER}, \code{LNAME}, \code{USERNAME} #' environment variables first. Then it tries the `id` command on Unix-like #' platforms and `whoami` on Windows. #' #' @param fallback If not \code{NULL} then this value is returned #' if the username cannot be found, instead of triggering an error. #' @return The user name of the current user. #' #' @family user names #' @export #' @examples #' \dontrun{ #' username() #' } username <- function(fallback = NULL) { e <- Sys.getenv() user <- e["LOGNAME"] %or% e["USER"] %or% e["LNAME"] %or% e["USERNAME"] if (ok(user)) return(as.vector(user)) if (.Platform$OS.type == "unix") { user <- try(str_trim(system("id -un", intern = TRUE)), silent = TRUE) if (ok(user)) return(user) } else if (.Platform$OS.type == "windows") { user <- try({ user <- system("whoami", intern = TRUE, show.output.on.console = FALSE) user <- sub("^.*\\\\", "", str_trim(user)) }, silent = TRUE) if (ok(user)) return(user) } else { return(fallback_or_stop( fallback, "Unknown platform, cannot determine username" )) } fallback_or_stop(fallback, "Cannot determine username") } #' Full name of the current user #' #' Uses the \code{FULLNAME} environment variable, if set. #' Otherwise tries system full names and the git configuration as well. #' #' @param fallback If not \code{NULL} then this value is returned #' if the full name of the user cannot be found, instead of #' triggering an error. #' @return The full name of the current user. #' #' @family user names #' @export #' @examples #' \dontrun{ #' fullname() #' } fullname <- function(fallback = NULL) { if ((x <- Sys.getenv("FULLNAME", "")) != "") return(x) if (Sys.info()["sysname"] == "Darwin") { user <- try({ user <- system("id -P", intern = TRUE) user <- str_trim(user) user <- strsplit(user, ":")[[1]][8] }, silent = TRUE) if (ok(user)) return(user) user <- try({ user <- system("osascript -e \"long user name of (system info)\"", intern = TRUE) user <- str_trim(user) }, silent = TRUE) if (ok(user)) return(user) } else if (.Platform$OS.type == "windows") { user <- try(suppressWarnings({ user <- system("git config --global user.name", intern = TRUE) user <- str_trim(user) }), silent = TRUE) if (ok(user)){ return(user) } else{ user <- try(suppressWarnings({ user <- system(paste0("git config --file ", file.path(Sys.getenv("USERPROFILE"), ".gitconfig"), " user.name"), intern = TRUE) user <- str_trim(user) }), silent = TRUE) if(ok(user)){ return(user) } } user <- try({ username <- username() user <- system( paste0("wmic useraccount where name=\"", username, "\" get fullname"), intern = TRUE ) user <- sub("FullName", "", user) user <- str_trim(paste(user, collapse = "")) }, silent = TRUE) if (ok(user)) return(user) } else { user <- try({ user <- system("getent passwd $(whoami)", intern = TRUE) user <- str_trim(user) user <- strsplit(user, ":")[[1]][5] user <- sub(",.*", "") }, silent = TRUE) if (ok(user)) return(user) } user <- try(suppressWarnings({ user <- system("git config --global user.name", intern = TRUE) user <- str_trim(user) }), silent = TRUE) if (ok(user)){ return(user) } else{ user <- try(suppressWarnings({ user <- system(paste0("git config --file ", file.path(Sys.getenv("USERPROFILE"), ".gitconfig"), " user.name"), intern = TRUE) user <- str_trim(user) }), silent = TRUE) if(ok(user)){ return(user) } } fallback_or_stop(fallback, "Cannot determine full name") } #' Email address of the current user #' #' If uses the \code{EMAIL} environment variable, if set. #' Otherwise it tries to find it in the user's global git configuration. #' #' @param fallback If not \code{NULL} then this value is returned #' if the email address cannot be found, instead of triggering an error. #' @return Email address on success. Otherwise an error is thrown. #' #' @family user names #' @export #' @examples #' \dontrun{ #' email_address() #' } email_address <- function(fallback = NULL) { if ((x <- Sys.getenv("EMAIL", "")) != "") return(x) email <- try(suppressWarnings({ email <- system("git config --global user.email", intern = TRUE) email <- str_trim(email) }), silent = TRUE) if (ok(email)){ return(email) } else{ user <- try(suppressWarnings({ email <- system(paste0("git config --file ", file.path(Sys.getenv("USERPROFILE"), ".gitconfig"), " user.email"), intern = TRUE) email <- str_trim(email) }), silent = TRUE) if(ok(email)){ return(email) } } fallback_or_stop(fallback, "Cannot get email address") } #' Find the current user's GitHub username #' #' Uses the \code{GITHUB_USERNAME} global variable or searches on GitHub, #' for the user's email address, see #' \code{\link{email_address}}. #' #' 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. #' #' @param token GitHub token to use. By default it uses #' the \code{GITHUB_TOKEN} environment variable, if set. #' If unset, uses the \code{GITHUB_PAT} environment #' variable, if set. #' @param fallback If not \code{NULL} then this value is returned #' if the GitHub username cannot be found, instead of triggering an #' error. #' @return GitHub username, or an error is thrown if it cannot be found. #' #' @family user names #' @export #' @importFrom httr GET add_headers status_code content #' @importFrom jsonlite fromJSON #' @importFrom utils URLencode #' @examples #' \dontrun{ #' gh_username() #' } gh_username <- function(token = NULL, fallback = NULL) { # try reading username from global variable env_gh_username <- Sys.getenv("GITHUB_USERNAME") if (nzchar(env_gh_username)) return(env_gh_username) email <- try(email_address(), silent = TRUE) if (ok(email)) { if (! grepl('@', email)) { return(fallback_or_stop( fallback, "This does not seem to be an email address" )) } lookup_gh_username(email, token) } else { fallback_or_stop(fallback, "Cannot get GitHub username") } } lookup_gh_username <- function(email, token) { url <- URLencode(paste0(gh_url, "/search/users?q=", email, " in:email")) if(is.null(token)){ token <- Sys.getenv("GITHUB_TOKEN", Sys.getenv("GITHUB_PAT")) } auth <- character() if (token != "") auth <- c("Authorization" = paste("token", token)) resp <- GET( url, add_headers("user-agent" = "https://github.com/r-lib/whoami", 'accept' = 'application/vnd.github.v3+json', .headers = auth) ) if (status_code(resp) >= 300) { return(fallback_or_stop(fallback, "Cannot find GitHub username")) } data <- fromJSON(content(resp, as = "text"), simplifyVector = FALSE) if (data$total_count == 0) { return( fallback_or_stop(fallback, "Cannot find GitHub username for email") ) } data$items[[1]]$login } #' User name and full name of the current user #' #' Calls \code{\link{username}} and \code{\link{fullname}}. #' #' @return A named character vector with entries: \code{username}, #' \code{fullname}, \code{email_address}, \code{gh_username}. #' #' @family user names #' @export #' @examples #' \dontrun{ #' whoami() #' } #' @details #' 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. whoami <- function() { c("username" = username(), "fullname" = fullname(), "email_address" = email_address(), "gh_username" = gh_username() ) } whoami/MD50000644000176200001440000000171213444154703012054 0ustar liggesusersd53fd134ef4ae569bb9454f48201f1f6 *DESCRIPTION df787079ebcc8d97d5f6892d0568349d *LICENSE e6b916493e61a51a8fa3028a443778df *NAMESPACE 6180f17373bbdcbdc921ca6ec2c7170a *R/whoami.R 8a14e3043f8ff4b472d7127e05250c6c *inst/NEWS.md e4877c2ea6ab04a5d0df81454669ef24 *inst/README.md 1d256f8854cf2b33ee3743cffe9d8c85 *man/email_address.Rd 5e65c76a645658fec78a2643ed118fdb *man/fullname.Rd 67d4947ab367a6e7d51b857561d598e7 *man/gh_username.Rd 4ea56c75cd81c355da29d48a76fe923f *man/username.Rd 01502d7f876d2bd0b0297f114016e2c7 *man/whoami.Rd 80126b3653b5eb5987fe10b7b507251c *tests/testthat.R 65b2c70bb340735371a114c77398b165 *tests/testthat/test-email.R 150356f5faf25195ac11f4ba11fb182f *tests/testthat/test-fallbacks.R 65951ac2f854f3c441f1c81d3b579041 *tests/testthat/test-fullname.R e72b7c2b60f7fbedc45f1c6a8c946e6d *tests/testthat/test-gh-username.R cc9262c3b989fa9382fc7c9a1e211b4d *tests/testthat/test-memoize.R 8a77b11bf3e913ae9760283ef56c6d00 *tests/testthat/test-username.R whoami/DESCRIPTION0000644000176200001440000000206113444154703013250 0ustar liggesusersPackage: whoami Title: Username, Full Name, Email Address, 'GitHub' Username of the Current User Version: 1.3.0 Authors@R: c(person(given = "Gábor", family = "Csárdi", email = "csardi.gabor@gmail.com", role = c("aut", "cre")), person(given = "Maëlle", family = "Salmon", role = "ctb")) 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. License: MIT + file LICENSE URL: https://github.com/r-lib/whoami#readme BugReports: https://github.com/r-lib/whoami/issues Imports: httr, jsonlite, utils Suggests: covr, mockery, testthat, withr Encoding: UTF-8 RoxygenNote: 6.1.1 NeedsCompilation: no Packaged: 2019-03-19 11:47:24 UTC; gaborcsardi Author: Gábor Csárdi [aut, cre], Maëlle Salmon [ctb] Maintainer: Gábor Csárdi Repository: CRAN Date/Publication: 2019-03-19 12:00:03 UTC whoami/man/0000755000176200001440000000000013442316114012310 5ustar liggesuserswhoami/man/email_address.Rd0000644000176200001440000000137013444150737015405 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/whoami.R \name{email_address} \alias{email_address} \title{Email address of the current user} \usage{ email_address(fallback = NULL) } \arguments{ \item{fallback}{If not \code{NULL} then this value is returned if the email address cannot be found, instead of triggering an error.} } \value{ Email address on success. Otherwise an error is thrown. } \description{ If uses the \code{EMAIL} environment variable, if set. Otherwise it tries to find it in the user's global git configuration. } \examples{ \dontrun{ email_address() } } \seealso{ Other user names: \code{\link{fullname}}, \code{\link{gh_username}}, \code{\link{username}}, \code{\link{whoami}} } \concept{user names} whoami/man/gh_username.Rd0000644000176200001440000000215413444150535015103 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/whoami.R \name{gh_username} \alias{gh_username} \title{Find the current user's GitHub username} \usage{ gh_username(token = NULL, fallback = NULL) } \arguments{ \item{token}{GitHub token to use. By default it uses the \code{GITHUB_TOKEN} environment variable, if set. If unset, uses the \code{GITHUB_PAT} environment variable, if set.} \item{fallback}{If not \code{NULL} then this value is returned if the GitHub username cannot be found, instead of triggering an error.} } \value{ GitHub username, or an error is thrown if it cannot be found. } \description{ Uses the \code{GITHUB_USERNAME} global variable or searches on GitHub, for the user's email address, see \code{\link{email_address}}. } \details{ 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. } \examples{ \dontrun{ gh_username() } } \seealso{ Other user names: \code{\link{email_address}}, \code{\link{fullname}}, \code{\link{username}}, \code{\link{whoami}} } \concept{user names} whoami/man/username.Rd0000644000176200001440000000141113444150535014420 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/whoami.R \name{username} \alias{username} \title{User name of the current user} \usage{ username(fallback = NULL) } \arguments{ \item{fallback}{If not \code{NULL} then this value is returned if the username cannot be found, instead of triggering an error.} } \value{ The user name of the current user. } \description{ Tries the \code{LOGNAME}, \code{USER}, \code{LNAME}, \code{USERNAME} environment variables first. Then it tries the \code{id} command on Unix-like platforms and \code{whoami} on Windows. } \examples{ \dontrun{ username() } } \seealso{ Other user names: \code{\link{email_address}}, \code{\link{fullname}}, \code{\link{gh_username}}, \code{\link{whoami}} } \concept{user names} whoami/man/fullname.Rd0000644000176200001440000000132713444150737014416 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/whoami.R \name{fullname} \alias{fullname} \title{Full name of the current user} \usage{ fullname(fallback = NULL) } \arguments{ \item{fallback}{If not \code{NULL} then this value is returned if the full name of the user cannot be found, instead of triggering an error.} } \value{ The full name of the current user. } \description{ Uses the \code{FULLNAME} environment variable, if set. Otherwise tries system full names and the git configuration as well. } \examples{ \dontrun{ fullname() } } \seealso{ Other user names: \code{\link{email_address}}, \code{\link{gh_username}}, \code{\link{username}}, \code{\link{whoami}} } \concept{user names} whoami/man/whoami.Rd0000644000176200001440000000270013444150535014067 0ustar liggesusers% Generated by roxygen2: do not edit by hand % Please edit documentation in R/whoami.R \name{whoami} \alias{whoami} \title{User name and full name of the current user} \usage{ whoami() } \value{ A named character vector with entries: \code{username}, \code{fullname}, \code{email_address}, \code{gh_username}. } \description{ Calls \code{\link{username}} and \code{\link{fullname}}. } \details{ For the username it tries the \code{LOGNAME}, \code{USER}, \code{LNAME} and \code{USERNAME} environment variables first. If these are all unset, or set to an empty string, then it tries running \code{id} on Unix-like systems and \code{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 \code{Sys.getenv("USERPROFILE")} if it doesn't find it in \code{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 \code{Sys.getenv("USERPROFILE")} if it doesn't find it in \code{Sys.getenv("HOME")}. For the GitHub username it uses the \code{GITHUB_USERNAME} environment variable then it tries searching on GitHub for the user's email address. } \examples{ \dontrun{ whoami() } } \seealso{ Other user names: \code{\link{email_address}}, \code{\link{fullname}}, \code{\link{gh_username}}, \code{\link{username}} } \concept{user names} whoami/LICENSE0000644000176200001440000000006113442316114012537 0ustar liggesusersYEAR: 2015-2017 COPYRIGHT HOLDER: Gábor Csárdi