Skip to content

Commit 0d0caed

Browse files
authored
Merge pull request #36 from explodecomputer/update-dictionary-09102025
dictionary update for cp_4a
2 parents f25ac74 + 9b08619 commit 0d0caed

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

R/dictionary.r

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,25 @@ retrieveDictionary <- function(name) {
5151
}
5252
}
5353

54-
saveDictionary <- function(name, dictionary) {
55-
# Save in the globals environment
54+
55+
saveDictionary <- function(name, dictionary, overwrite = TRUE) {
56+
# Save in the globals environment
57+
5658
assign(name, dictionary, globals)
5759

5860
# -------------------------------
5961
# 1️⃣ Save CRAN/GitHub-compliant copy (/data/)
6062
# -------------------------------
61-
data_path <- file.path(getwd(), "data") # always dev source tree
63+
64+
data_path <- file.path(getwd(), "data")
65+
6266
if (!dir.exists(data_path)) dir.create(data_path, recursive = TRUE)
6367

6468
save(list = name,
65-
file = file.path(data_path, paste0(name, ".rdata")),
69+
file = file.path(data_path, paste0(name, ".rda")),
6670
envir = globals)
6771

72+
6873
# -------------------------------
6974
# 2️⃣ Save dev copy (/inst/data/) for load_all() testing
7075
# -------------------------------
@@ -74,6 +79,9 @@ saveDictionary <- function(name, dictionary) {
7479
save(list = name,
7580
file = file.path(inst_path, paste0(name, ".rdata")),
7681
envir = globals)
82+
message("Dictionary '", name, "' saved to:\n",
83+
" - ", file.path(data_path, paste0(name, ".rda")), "\n",
84+
" - ", file.path(inst_path, paste0(name, ".rdata")))
7785
}
7886

7987
#' Checks a dictionary
File renamed without changes.

inst/data/current.rdata

824 KB
Binary file not shown.

0 commit comments

Comments
 (0)