-
Notifications
You must be signed in to change notification settings - Fork 14
/
getvue.R
64 lines (56 loc) · 1.31 KB
/
getvue.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# use the very nice rgithub; still works but abandoned
# remotes::install_github("cscheid/rgithub")
get_vue_latest <- function(){
gsub(
x=github::get.latest.release("vuejs", "vue")$content$tag_name,
pattern="v",
replacement=""
)
}
get_vue3_latest <- function(){
gsub(
x=github::get.latest.release("vuejs", "core")$content$tag_name,
pattern="v",
replacement=""
)
}
# get newest vue2
download.file(
url=sprintf(
"https://unpkg.com/vue@%s/dist/vue.min.js",
get_vue_latest()
),
destfile="./inst/www/vue/dist/vue.min.js"
)
download.file(
url=sprintf(
"https://unpkg.com/vue@%s/dist/vue.js",
get_vue_latest()
),
destfile="./inst/www/vue/dist/vue.js"
)
# get newest vue3
download.file(
url=sprintf(
"https://unpkg.com/vue@%s/dist/vue.global.prod.js",
get_vue3_latest()
),
destfile="./inst/www/vue3/dist/vue.global.prod.js"
)
download.file(
url=sprintf(
"https://unpkg.com/vue@%s/dist/vue.global.js",
get_vue3_latest()
),
destfile="./inst/www/vue3/dist/vue.global.js"
)
# write function with newest version
# for use when creating dependencies
cat(
sprintf(
"#'@keywords internal\nvue_version <- function(){'%s'}\n#'@keywords internal\nvue3_version <- function(){'%s'}\n",
get_vue_latest(),
get_vue3_latest()
),
file = "./R/meta.R"
)