Skip to content

Commit eaf3aea

Browse files
committed
Avoid package 'yay'
1 parent 81ed807 commit eaf3aea

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tools/update_plotlyjs.R

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,16 @@ withr::with_dir(tmpdir, {
6666
overwrite = TRUE
6767
)
6868
# update plot schema and (partial) bundles
69-
if (!nzchar(system.file(package = "yay"))) {
70-
stop("pkg 'yay' must be installed via: remotes::install_gitlab('rpkg.dev/yay')")
71-
}
7269
Schema <- jsonlite::fromJSON(Sys.glob("dist/plot-schema.json"))
70+
tmp_file <- tempfile(pattern = "plotly_constants_", fileext = ".js")
71+
utils::download.file(
72+
url = paste0("https://raw.githubusercontent.com/plotly/plotly.js/", basename(zip), "/tasks/util/constants.js"),
73+
destfile = tmp_file,
74+
quiet = TRUE,
75+
mode = "wb"
76+
)
7377
bundleTraceMap <-
74-
yay::gh_text_file(path = "tasks/util/constants.js",
75-
owner = "plotly",
76-
name = "plotly.js",
77-
rev = basename(zip)) |>
78+
paste0(readLines(tmp_file), collapse = "\n") |>
7879
stringr::str_extract(pattern = "(?<=var partialBundleTraces = )\\{[^}]+\\}") |>
7980
yaml::read_yaml(text = _)
8081

0 commit comments

Comments
 (0)