1
- library(httr )
2
- library(rprojroot )
3
-
4
1
# get zip URL to latest plotly.js release
5
- x <- RETRY(
2
+ x <- httr :: RETRY(
6
3
verb = " GET" ,
7
4
url = ' https://api.github.com/repos/plotly/plotly.js/releases/latest' ,
8
5
times = 5 ,
9
6
terminate_on = c(400 , 401 , 403 , 404 ),
10
7
terminate_on_success = TRUE
11
8
)
12
- zip <- content(x )$ zipball_url
9
+ zip <- httr :: content(x )$ zipball_url
13
10
14
11
# 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" )
17
14
patches <- list.files(
18
- find_package_root_file(" tools/patches" ),
15
+ rprojroot :: find_package_root_file(" tools/patches" ),
19
16
full.names = TRUE
20
17
)
21
18
@@ -25,8 +22,8 @@ dir.create(tmpdir)
25
22
26
23
withr :: with_dir(tmpdir , {
27
24
# 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" )
30
27
31
28
withr :: with_dir(
32
29
dir(" plotly-js" , full.names = TRUE ), {
0 commit comments