Skip to content

Commit 3f1c169

Browse files
committed
Squashed commit of the following:
commit 7ea4fa7 Author: Kirill Müller <kirill@cynkra.com> Date: Fri Jan 23 17:12:53 2026 +0100 feat: Add `date` and `overwrite` arguments to `cpp_vendor()` commit 6ea648d Author: Kirill Müller <kirill@cynkra.com> Date: Fri Jan 23 15:45:04 2026 +0100 Squashed commit of the following: commit 8b16df3 Author: Kirill Müller <krlmlr@users.noreply.github.com> Date: Thu Jan 22 07:37:45 2026 +0100 Formatting commit f557b0b Author: Kirill Müller <krlmlr@users.noreply.github.com> Date: Thu Jan 22 07:35:10 2026 +0100 Clarify commit ac9756b Author: Kirill Müller <krlmlr@users.noreply.github.com> Date: Thu Jan 22 07:06:41 2026 +0100 Remove commit 64be6e7 Author: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu Jan 22 07:05:34 2026 +0100 Add test for external_pointer attribute preservation and fix move assignment operator (r-lib#486) Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> commit 1db6beb Author: Kirill Müller <kirill@cynkra.com> Date: Sat Dec 7 20:47:09 2024 +0100 fix: Avoid premature release for external pointers commit e1e31b8 Author: Kirill Müller <kirill@cynkra.com> Date: Fri Jan 23 15:45:04 2026 +0100 Squashed commit of the following: commit 1807106 Author: Kirill Müller <kirill@cynkra.com> Date: Sat Dec 7 20:45:20 2024 +0100 fix: Copy strings before calling `Rf_warningcall()` to avoid weird unwind behavior commit c255629 Author: Kirill Müller <kirill@cynkra.com> Date: Fri Jan 23 15:45:04 2026 +0100 Squashed commit of the following: commit 0e20f8f Author: Kirill Müller <kirill@cynkra.com> Date: Sat Dec 7 20:42:58 2024 +0100 feat: New `END_CPP11_EX()` macro that allows parameterizing the return value commit 579dbcf Author: Kirill Müller <kirill@cynkra.com> Date: Fri Jan 23 15:45:04 2026 +0100 Squashed commit of the following: commit d17d404 Author: Kirill Müller <kirill@cynkra.com> Date: Sat Dec 7 20:39:59 2024 +0100 Format commit 35fe905 Author: Kirill Müller <kirill@cynkra.com> Date: Sat Dec 7 20:38:22 2024 +0100 feat: Add `prot` argument to `external_pointer()` constructor commit db81744 Author: Kirill Müller <kirill@cynkra.com> Date: Fri Jan 23 15:45:03 2026 +0100 Squashed commit of the following: commit 6a9c76c Author: Kirill Müller <kirill@cynkra.com> Date: Mon Oct 23 09:47:00 2023 +0200 Vectorize file argument to cpp_source()
1 parent 2b4380b commit 3f1c169

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

R/vendor.R

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,15 @@
3030
#'
3131
#' # cleanup
3232
#' unlink(dir, recursive = TRUE)
33-
cpp_vendor <- function(path = ".") {
33+
cpp_vendor <- function(path = ".", date = Sys.Date(), overwrite = FALSE) {
3434
new <- file.path(path, "inst", "include", "cpp11")
3535

3636
if (dir.exists(new)) {
37-
stop("'", new, "' already exists\n * run unlink('", new, "', recursive = TRUE)", call. = FALSE)
37+
if (overwrite) {
38+
unlink(new, recursive = TRUE)
39+
} else {
40+
stop("'", new, "' already exists\n * run unlink('", new, "', recursive = TRUE)", call. = FALSE)
41+
}
3842
}
3943

4044
dir.create(new , recursive = TRUE, showWarnings = FALSE)
@@ -46,7 +50,7 @@ cpp_vendor <- function(path = ".") {
4650

4751
cpp11_version <- utils::packageVersion("cpp11")
4852

49-
cpp11_header <- sprintf("// cpp11 version: %s\n// vendored on: %s", cpp11_version, Sys.Date())
53+
cpp11_header <- sprintf("// cpp11 version: %s\n// vendored on: %s", cpp11_version, as.Date(date))
5054

5155
files <- list.files(current, full.names = TRUE)
5256

0 commit comments

Comments
 (0)