diff --git a/inst/gha/data-apps-deps-update.R b/inst/gha/data-apps-deps-update.R index 611aa3e812..65b8648c2c 100644 --- a/inst/gha/data-apps-deps-update.R +++ b/inst/gha/data-apps-deps-update.R @@ -14,7 +14,7 @@ update_apps_deps <- function(repo_dir = ".") { subset( revdeps, !( - Package %in% c(base_packages(), "shinycoreci") + Package %in% c(base_packages()) ) ) apps_deps <- sort(unique(revdeps$Package)) @@ -28,13 +28,23 @@ update_apps_deps <- function(repo_dir = ".") { apps_deps_txt <- utils::capture.output(dput(apps_deps)) apps_deps_map_txt <- utils::capture.output(dput(apps_deps_map)) + # Pretty format + apps_deps_map_txt <- paste0(apps_deps_map_txt, collapse = "\n") + apps_deps_map_txt <- gsub("\n", "", apps_deps_map_txt) + apps_deps_map_txt <- gsub("\\s+", " ", apps_deps_map_txt) + apps_deps_map_txt <- gsub("(`", "(\n `", apps_deps_map_txt, fixed = TRUE) + apps_deps_map_txt <- gsub(", `", ",\n `", apps_deps_map_txt, fixed = TRUE) + apps_deps_map_txt <- gsub("))", ")\n)", apps_deps_map_txt, fixed = TRUE) + apps_deps_map_txt <- gsub(" )", ")", apps_deps_map_txt, fixed = TRUE) + + cat( file = file.path(repo_dir, "R/data-apps-deps.R"), sep = "", "# Do not edit by hand!\n", "# This file is automatically generated by `./inst/gha/data-apps-deps-update.R`\n", "apps_deps <- ", paste0(apps_deps_txt, collapse = "\n"), "\n", - "apps_deps_map <- ", paste0(apps_deps_map_txt, collapse = "\n"), "\n" + "apps_deps_map <- ", apps_deps_map_txt, "\n" ) }