Skip to content

Commit 21c2f0e

Browse files
committed
Use explicit pkg namespaces
This makes non-base-R dependencies clearly apparent
1 parent eaf3aea commit 21c2f0e

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

tools/update_plotlyjs.R

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
library(httr)
2-
library(rprojroot)
3-
41
# get zip URL to latest plotly.js release
5-
x <- RETRY(
2+
x <- httr::RETRY(
63
verb = "GET",
74
url = 'https://api.github.com/repos/plotly/plotly.js/releases/latest',
85
times = 5,
96
terminate_on = c(400, 401, 403, 404),
107
terminate_on_success = TRUE
118
)
12-
zip <- content(x)$zipball_url
9+
zip <- httr::content(x)$zipball_url
1310

1411
# remember where to copy over assets
15-
pkg_dir <- find_package_root_file()
16-
lib_dir <- find_package_root_file("inst/htmlwidgets/lib/plotlyjs")
12+
pkg_dir <- rprojroot::find_package_root_file()
13+
lib_dir <- rprojroot::find_package_root_file("inst/htmlwidgets/lib/plotlyjs")
1714
patches <- list.files(
18-
find_package_root_file("tools/patches"),
15+
rprojroot::find_package_root_file("tools/patches"),
1916
full.names = TRUE
2017
)
2118

@@ -25,8 +22,8 @@ dir.create(tmpdir)
2522

2623
withr::with_dir(tmpdir, {
2724
# download source
28-
download.file(zip, "plotly-js.zip")
29-
unzip("plotly-js.zip", exdir = "plotly-js")
25+
utils::download.file(zip, "plotly-js.zip")
26+
utils::unzip("plotly-js.zip", exdir = "plotly-js")
3027

3128
withr::with_dir(
3229
dir("plotly-js", full.names = TRUE), {

0 commit comments

Comments
 (0)