mirror of
https://github.com/denoland/deno.git
synced 2025-01-05 13:59:01 -05:00
fix(cli): add colors to "Module not found" error frame (#18437)
This commit is contained in:
parent
2813a27364
commit
e06bd19a69
2 changed files with 7 additions and 2 deletions
|
@ -96,7 +96,12 @@ pub fn graph_valid(
|
|||
|
||||
if let Some(range) = error.maybe_range() {
|
||||
if !is_root && !range.specifier.as_str().contains("/$deno$eval") {
|
||||
message.push_str(&format!("\n at {range}"));
|
||||
message.push_str(&format!(
|
||||
"\n at {}:{}:{}",
|
||||
colors::cyan(range.specifier.as_str()),
|
||||
colors::yellow(&(range.start.line + 1).to_string()),
|
||||
colors::yellow(&(range.start.character + 1).to_string())
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
cli/tools/vendor/build.rs
vendored
2
cli/tools/vendor/build.rs
vendored
|
@ -1117,7 +1117,7 @@ mod test {
|
|||
.unwrap();
|
||||
|
||||
assert_eq!(
|
||||
err.to_string(),
|
||||
test_util::strip_ansi_codes(&err.to_string()),
|
||||
concat!(
|
||||
"500 Internal Server Error\n",
|
||||
" at https://localhost/mod.ts:1:14"
|
||||
|
|
Loading…
Reference in a new issue