Skip to content

Commit

Permalink
Merge pull request #253 from carpentries/fix-252
Browse files Browse the repository at this point in the history
don't use newlines in set_config()
  • Loading branch information
zkamvar authored Feb 14, 2022
2 parents 12faee2 + 70e2c07 commit 0400e85
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sandpaper
Title: Create and Curate Carpentries Lessons
Version: 0.1.5
Version: 0.1.6
Authors@R: c(
person(given = "Zhian N.",
family = "Kamvar",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# sandpaper 0.1.6

BUG FIX
-------

* `set_dropdown()` no longer fails with {cli} version 3.2.0

# sandpaper 0.1.5

INTERNAL
Expand Down
4 changes: 2 additions & 2 deletions R/set_dropdown.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ set_config <- function(pairs = NULL, path = ".", write = FALSE) {
cli::cli_text(c(cli::col_yellow("+ "), line[i]))
}
the_call[["write"]] <- TRUE
cll <- paste(utils::capture.output(the_call), collapse = "\n")
cll <- gsub("\\s+", " ", paste(utils::capture.output(the_call), collapse = ""))
cli::cli_alert_info("To save this configuration, use\n\n{.code {cll}}")
return(the_call)
return(invisible(the_call))
}
}

Expand Down
6 changes: 1 addition & 5 deletions tests/testthat/_snaps/set_dropdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
+ license: 'CC0'
i To save this configuration, use
`set_config(pairs = list(title = "test: title", license = "CC0"),
path = tmp, write = TRUE)`
Output
set_config(pairs = list(title = "test: title", license = "CC0"),
path = tmp, write = TRUE)
`set_config(pairs = list(title = "test: title", license = "CC0"), path = tmp, write = TRUE)`

# set_config() will write items [plain]

Expand Down

0 comments on commit 0400e85

Please sign in to comment.