Skip to content

Commit 65ba6e5

Browse files
committed
Add some cli funtions to NAMESPACE
1 parent 1c4daa7 commit 65ba6e5

File tree

3 files changed

+29
-12
lines changed

3 files changed

+29
-12
lines changed

NAMESPACE

+4
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ export(use_metadata)
1616
export(validate_archive)
1717
importFrom(cli,cat_line)
1818
importFrom(cli,cli_abort)
19+
importFrom(cli,cli_bullets)
20+
importFrom(cli,cli_fmt)
1921
importFrom(cli,cli_h2)
2022
importFrom(cli,cli_h3)
2123
importFrom(cli,cli_inform)
24+
importFrom(cli,cli_progress_done)
2225
importFrom(cli,cli_progress_step)
2326
importFrom(cli,cli_progress_update)
27+
importFrom(cli,col_grey)
2428
importFrom(corella,check_dataset)
2529
importFrom(corella,suggest_workflow)
2630
importFrom(curl,form_data)

R/use_metadata.R

+10-8
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,37 @@
2828
#' @importFrom cli cli_progress_step
2929
#' @importFrom cli cli_progress_done
3030
#' @importFrom cli cli_bullets
31+
#' @importFrom cli cli_fmt
32+
#' @importFrom cli col_grey
3133
#' @export
3234
use_metadata <- function(file, overwrite = FALSE){
3335
if(missing(file)){
34-
cli::cli_progress_step("Creating template file {.file metadata.md}.")
36+
cli_progress_step("Creating template file {.file metadata.md}.")
3537
file <- "metadata.md"
3638
cli::cli_progress_done()
3739
}
3840
if(overwrite){
39-
cli::cli_progress_step("Overwriting existing file {.file {file}}.")
41+
cli_progress_step("Overwriting existing file {.file {file}}.")
4042
write_md(paperbark::metadata_example, file = file)
41-
cli::cli_progress_done()
43+
cli_progress_done()
4244
}else{
4345
if(file.exists(file)){
4446
bullets <- c("File {.file {file}} already exists.",
4547
i = "Use a different filename or set `overwrite = TRUE`") |>
46-
cli::cli_bullets() |>
47-
cli::cli_fmt()
48+
cli_bullets() |>
49+
cli_fmt()
4850

4951
abort(bullets)
5052
}else{
5153
write_md(paperbark::metadata_example, file = file)
5254
}
5355
}
5456

55-
cli::cli_bullets(c(
57+
cli_bullets(c(
5658
v = "File template {.file {file}} saved to top folder in local directory.",
5759
i = paste(
58-
c(" Edit {.file {file}}") |> cli::col_grey(),
59-
c("then use {.fn build_metadata} to build final metadata statement.") |> cli::col_grey()
60+
c(" Edit {.file {file}}") |> col_grey(),
61+
c("then use {.fn build_metadata} to build final metadata statement.") |> col_grey()
6062
)
6163
))
6264

man/use_metadata.Rd

+15-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)