forked from r-lib/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzzz.R
74 lines (68 loc) · 2.37 KB
/
zzz.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#' @importFrom utils available.packages contrib.url install.packages
#' installed.packages modifyList packageDescription
#' packageVersion remove.packages
#' @importFrom cli cat_rule cat_line cat_bullet
NULL
#' Package development tools for R.
#'
#' @section Package options:
#'
#' Devtools uses the following [options()] to configure behaviour:
#'
#' \itemize{
#' \item `devtools.path`: path to use for [dev_mode()]
#'
#' \item `devtools.name`: your name, used when signing draft
#' emails.
#'
#' \item `devtools.install.args`: a string giving extra arguments passed
#' to `R CMD install` by [install()].
#'
#' \item `devtools.desc.author`: a string providing a default Authors@@R
#' string to be used in new \file{DESCRIPTION}s. Should be a R code, and
#' look like `"Hadley Wickham <h.wickham@@gmail.com> [aut, cre]"`. See
#' [utils::as.person()] for more details.
#'
#' \item `devtools.desc.license`: a default license string to use for
#' new packages.
#'
#' \item `devtools.desc.suggests`: a character vector listing packages to
#' to add to suggests by defaults for new packages.
#
#' \item `devtools.desc`: a named list listing any other
#' extra options to add to \file{DESCRIPTION}
#'
#' }
#' @docType package
#' @name devtools
"_PACKAGE"
#' Deprecated Functions
#'
#' These functions are Deprecated in this release of devtools, they will be
#' marked as Defunct and removed in a future version.
#' @name devtools-deprecated
#' @keywords internal
NULL
devtools_default_options <- list(
devtools.path = "~/R-dev",
devtools.install.args = "",
devtools.name = "Your name goes here",
devtools.desc.author = 'person("First", "Last", email = "[email protected]", role = c("aut", "cre"))',
devtools.desc.license = "What license is it under?",
devtools.desc.suggests = NULL,
devtools.desc = list(),
devtools.revdep.libpath = file.path(tempdir(), "R-lib")
)
.onLoad <- function(libname, pkgname) {
op <- options()
toset <- !(names(devtools_default_options) %in% names(op))
if (any(toset)) options(devtools_default_options[toset])
invisible()
}
.onAttach <- function(libname, pkgname) {
env <- as.environment(paste0("package:", pkgname))
env[[".conflicts.OK"]] <- TRUE
usethis_lib <- dirname(getNamespaceInfo("usethis", "path"))
suppressPackageStartupMessages((
get("library", baseenv()))("usethis", lib.loc = usethis_lib))
}