File tree 3 files changed +29
-12
lines changed
3 files changed +29
-12
lines changed Original file line number Diff line number Diff line change @@ -16,11 +16,15 @@ export(use_metadata)
16
16
export(validate_archive)
17
17
importFrom(cli,cat_line)
18
18
importFrom(cli,cli_abort)
19
+ importFrom(cli,cli_bullets)
20
+ importFrom(cli,cli_fmt)
19
21
importFrom(cli,cli_h2)
20
22
importFrom(cli,cli_h3)
21
23
importFrom(cli,cli_inform)
24
+ importFrom(cli,cli_progress_done)
22
25
importFrom(cli,cli_progress_step)
23
26
importFrom(cli,cli_progress_update)
27
+ importFrom(cli,col_grey)
24
28
importFrom(corella,check_dataset)
25
29
importFrom(corella,suggest_workflow)
26
30
importFrom(curl,form_data)
Original file line number Diff line number Diff line change 28
28
# ' @importFrom cli cli_progress_step
29
29
# ' @importFrom cli cli_progress_done
30
30
# ' @importFrom cli cli_bullets
31
+ # ' @importFrom cli cli_fmt
32
+ # ' @importFrom cli col_grey
31
33
# ' @export
32
34
use_metadata <- function (file , overwrite = FALSE ){
33
35
if (missing(file )){
34
- cli :: cli_progress_step(" Creating template file {.file metadata.md}." )
36
+ cli_progress_step(" Creating template file {.file metadata.md}." )
35
37
file <- " metadata.md"
36
38
cli :: cli_progress_done()
37
39
}
38
40
if (overwrite ){
39
- cli :: cli_progress_step(" Overwriting existing file {.file {file}}." )
41
+ cli_progress_step(" Overwriting existing file {.file {file}}." )
40
42
write_md(paperbark :: metadata_example , file = file )
41
- cli :: cli_progress_done()
43
+ cli_progress_done()
42
44
}else {
43
45
if (file.exists(file )){
44
46
bullets <- c(" File {.file {file}} already exists." ,
45
47
i = " Use a different filename or set `overwrite = TRUE`" ) | >
46
- cli :: cli_bullets() | >
47
- cli :: cli_fmt()
48
+ cli_bullets() | >
49
+ cli_fmt()
48
50
49
51
abort(bullets )
50
52
}else {
51
53
write_md(paperbark :: metadata_example , file = file )
52
54
}
53
55
}
54
56
55
- cli :: cli_bullets(c(
57
+ cli_bullets(c(
56
58
v = " File template {.file {file}} saved to top folder in local directory." ,
57
59
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()
60
62
)
61
63
))
62
64
You can’t perform that action at this time.
0 commit comments