Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c753eeb + a19a596 commit 0107df0Copy full SHA for 0107df0
1 file changed
pre_commit/languages/r.py
@@ -107,11 +107,13 @@ def install_environment(
107
'renv::activate("', file.path(getwd()), '"); '
108
)
109
writeLines(activate_statement, 'activate.R')
110
- is_package <- tryCatch({{
111
- content_desc <- read.dcf(file.path(prefix_dir, 'DESCRIPTION'))
112
- suppressWarnings(unname(content_desc[,'Type']) == "Package")
113
- }},
114
- error = function(...) FALSE
+ is_package <- tryCatch(
+ {{
+ path_desc <- file.path(prefix_dir, 'DESCRIPTION')
+ suppressWarnings(desc <- read.dcf(path_desc))
+ "Package" %in% colnames(desc)
115
+ }},
116
+ error = function(...) FALSE
117
118
if (is_package) {{
119
renv::install(prefix_dir)
0 commit comments