update version.qmd

This commit is contained in:
2025-11-26 15:33:47 +08:00
parent 474aca247c
commit 8b0c82c7ed
+8 -7
View File
@@ -14,17 +14,18 @@ tibble::tibble(branch = system("git branch -a", intern = TRUE)) |>
dplyr::filter(grepl("remotes", branch)) |> dplyr::filter(grepl("remotes", branch)) |>
dplyr::filter(!grepl("HEAD", branch)) |> dplyr::filter(!grepl("HEAD", branch)) |>
dplyr::mutate(branch = gsub("^.*\\/", "", branch)) |> dplyr::mutate(branch = gsub("^.*\\/", "", branch)) |>
dplyr::arrange(desc(branch)) |>
dplyr::mutate( dplyr::mutate(
htmlstr = paste0( htmlstr = paste0(
"## [**Version**: ", "## [**Version**: ",
branch, branch,
"](https://drc.drwater.net/{{< var projtype >}}/{{< var pubtype >}}/{{< var reponame >}}/", "](https://drc.drwater.net/{{< var projtype >}}/{{< var pubtype >}}/{{< var reponame >}}/",
branch, branch,
"/)<br><br>" "/)"
) )
) |> ) |>
dplyr::pull(htmlstr) |> dplyr::pull(htmlstr) |>
paste(collapse = "") |> paste(collapse = "\n\n") |>
cat() cat()
``` ```
@@ -38,8 +39,9 @@ tibble::tibble(branch = system("git branch -a", intern = TRUE)) |>
branches <- system("git branch -r", intern = TRUE) branches <- system("git branch -r", intern = TRUE)
branches <- trimws(branches) # 去除空白字符 branches <- trimws(branches) # 去除空白字符
branches <- branches[!grepl("HEAD", branches)] branches <- branches[!grepl("HEAD", branches)]
branches <- tibble::tibble(branch = branches) |>
all_commits <- list() dplyr::arrange(dplyr::desc(branch)) |>
dplyr::pull(branch)
cat("\n") cat("\n")
for (branch in branches) { for (branch in branches) {
@@ -53,10 +55,9 @@ for (branch in branches) {
), ),
intern = TRUE intern = TRUE
) )
all_commits[[branch]] <- paste0("- ", commits) # all_commits[[branch]] <- paste0("- ", commits)
cat("\n")
cat(paste0("- ", commits), sep = "\n") cat(paste0("- ", commits), sep = "\n")
cat("\n\n") cat("\n")
} }
} }
``` ```