Skip to content

Commit ceeb7bb

Browse files
committed
don't presume pre-commit-config exists in ensure_renv_compat
1 parent 6f38f96 commit ceeb7bb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

R/setup.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ ensure_renv_precommit_compat <- function(package_version_renv = utils::packageVe
179179
} else {
180180
withr::local_dir(root)
181181
path_config <- ".pre-commit-config.yaml"
182+
if (!file_exists(path_config)) {
183+
return()
184+
}
182185
config_lines <- readLines(path_config, encoding = "UTF-8")
183186
has_renv <- fs::file_exists("renv.lock")
184187
if (!has_renv) {

0 commit comments

Comments
 (0)