mirror of
https://github.com/denoland/deno.git
synced 2025-01-08 07:08:27 -05:00
fix(task): handle multiline descriptions properly (#27069)
Closes https://github.com/denoland/deno/issues/27049
This commit is contained in:
parent
467bbedf06
commit
594f59dc1d
3 changed files with 11 additions and 5 deletions
|
@ -721,11 +721,9 @@ fn print_available_tasks(
|
||||||
)?;
|
)?;
|
||||||
if let Some(description) = &desc.task.description {
|
if let Some(description) = &desc.task.description {
|
||||||
let slash_slash = colors::italic_gray("//");
|
let slash_slash = colors::italic_gray("//");
|
||||||
writeln!(
|
for line in description.split('\n') {
|
||||||
writer,
|
writeln!(writer, " {slash_slash} {}", colors::italic_gray(line))?;
|
||||||
" {slash_slash} {}",
|
}
|
||||||
colors::italic_gray(description)
|
|
||||||
)?;
|
|
||||||
}
|
}
|
||||||
writeln!(writer, " {}", desc.task.command)?;
|
writeln!(writer, " {}", desc.task.command)?;
|
||||||
if !desc.task.dependencies.is_empty() {
|
if !desc.task.dependencies.is_empty() {
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
"echo_emoji": {
|
"echo_emoji": {
|
||||||
"description": "This is some task",
|
"description": "This is some task",
|
||||||
"command": "echo 1"
|
"command": "echo 1"
|
||||||
|
},
|
||||||
|
"multiline_description": {
|
||||||
|
"description": "This is a multiline\ndescription",
|
||||||
|
"command": "echo 2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,3 +2,7 @@ Available tasks:
|
||||||
- echo_emoji
|
- echo_emoji
|
||||||
// This is some task
|
// This is some task
|
||||||
echo 1
|
echo 1
|
||||||
|
- multiline_description
|
||||||
|
// This is a multiline
|
||||||
|
// description
|
||||||
|
echo 2
|
||||||
|
|
Loading…
Reference in a new issue