Skip to content

Commit

Permalink
Repair tar_debug_instructions() for long commands
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Dec 11, 2023
1 parent 4a26bd0 commit 293d4df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Print "errored pipeline" when at least one target errors.
* Bump minimum `clustermq` version to 0.9.2.
* Repair the `tar_debug_instructions()` tips for when commands are long.

# targets 1.4.0

Expand Down
7 changes: 4 additions & 3 deletions R/tar_debug_instructions.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ tar_debug_instructions <- function() {
if (is.expression(expr)) {
expr <- expr[[1]]
}
text <- paste(" ", targets::tar_deparse_safe(expr))
deparsed <- targets::tar_deparse_safe(expr)
text <- paste(" ", deparsed)
cli_mark_info(
sprintf(
"You are now running an interactive debugger in target %s.",
Expand All @@ -37,14 +38,14 @@ tar_debug_instructions <- function() {
cli_mark_info(
paste0(
"Tip: run ",
sprintf("debug(%s)", deparse(expr)),
sprintf("debug(%s)", deparsed),
" and then enter \"c\""
)
)
cli_blank(
paste0(
"to move the debugger inside function ",
deparse(expr),
deparsed,
"()."
)
)
Expand Down

0 comments on commit 293d4df

Please sign in to comment.