mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Use more common package definition
This commit is contained in:
parent
7f13fa5d5f
commit
a19a59652f
1 changed files with 7 additions and 5 deletions
|
|
@ -107,9 +107,11 @@ def install_environment(
|
||||||
'renv::activate("', file.path(getwd()), '"); '
|
'renv::activate("', file.path(getwd()), '"); '
|
||||||
)
|
)
|
||||||
writeLines(activate_statement, 'activate.R')
|
writeLines(activate_statement, 'activate.R')
|
||||||
is_package <- tryCatch({{
|
is_package <- tryCatch(
|
||||||
content_desc <- read.dcf(file.path(prefix_dir, 'DESCRIPTION'))
|
{{
|
||||||
suppressWarnings(unname(content_desc[,'Type']) == "Package")
|
path_desc <- file.path(prefix_dir, 'DESCRIPTION')
|
||||||
|
suppressWarnings(desc <- read.dcf(path_desc))
|
||||||
|
"Package" %in% colnames(desc)
|
||||||
}},
|
}},
|
||||||
error = function(...) FALSE
|
error = function(...) FALSE
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue