Skip to content

Commit f260644

Browse files
if no pkgdown is present, skip hook.
This is useful for people who use the template and don't have pkgdown activated.
1 parent 5460f49 commit f260644

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

inst/hooks/exported/pkgdown.R

100644100755
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
#!/usr/bin/env Rscript
22

3+
if (is.null(pkgdown:::pkgdown_config_path("."))) {
4+
rlang::inform(paste0(
5+
"{pkgdown} seems not configured, the remainder of the check is skipped. ",
6+
"For this hook to not even be invoked, remove `id: pkgdown` from ",
7+
"`.pre-commit-config.yaml`."
8+
))
9+
quit()
10+
}
11+
312
if (!require(pkgdown, quietly = TRUE)) {
413
stop("{pkgdown} could not be loaded, please install it.")
514
}

0 commit comments

Comments
 (0)