Skip to content

Commit 07b8529

Browse files
committed
raise warning when loading package if missing binary file
1 parent 9754bd8 commit 07b8529

1 file changed

Lines changed: 2 additions & 21 deletions

File tree

R-pkg/R/zzz.R

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ env <- new.env(parent = emptyenv())
33
.onLoad <- function(libname, pkgname) {
44
# set up options
55
set_diyabcGUI_options(ncore = as.integer(0.75 * parallel::detectCores()))
6+
# setup package global environment
7+
init_diyabc_env()
68
# check if binary files are available
79
diyabc_bin <- tryCatch(
810
find_bin("diyabc"),
@@ -19,25 +21,4 @@ env <- new.env(parent = emptyenv())
1921
"'diyabcGUI::dl_all_latest_bin()'"
2022
)
2123
}
22-
# setup package global environment
23-
init_diyabc_env()
2424
}
25-
26-
# .onAttach <- function() {
27-
# # check if binary files are available
28-
# diyabc_bin <- tryCatch(
29-
# find_bin("diyabc"),
30-
# error = function(e) return(e)
31-
# )
32-
# abcranger_bin <- tryCatch(
33-
# find_bin("abcranger"),
34-
# error = function(e) return(e)
35-
# )
36-
# if("error" %in% class(diyabc_bin) | "error" %in% class(abcranger_bin)) {
37-
# packageStartupMessage(
38-
# "Warning: ",
39-
# "Missing binary file(s), please run ",
40-
# "'diyabcGUI::dl_all_latest_bin()'"
41-
# )
42-
# }
43-
# }

0 commit comments

Comments
 (0)