mirror of
https://github.com/rstudio/shiny.git
synced 2026-01-10 07:28:01 -05:00
7 lines
394 B
R
7 lines
394 B
R
# Updates the package.json `version` to match the DESCRIPTION `Version`
|
|
pkg <- jsonlite::read_json("package.json", simplifyVector = TRUE)
|
|
version <- as.list(read.dcf("DESCRIPTION")[1,])$Version
|
|
pkg$version <- gsub("^(\\d+).(\\d+).(\\d+).(.+)$", "\\1.\\2.\\3-alpha.\\4", version)
|
|
pkg$files <- as.list(pkg$files)
|
|
jsonlite::write_json(pkg, path = "package.json", pretty = TRUE, auto_unbox = TRUE)
|