Skip to content

Commit

Permalink
chore(platform_env): add warn prefix (#9261)
Browse files Browse the repository at this point in the history
### Description

Use correct warning output prefix

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->
  • Loading branch information
tknickman authored Oct 16, 2024
1 parent 9dafce0 commit 51b75dc
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions crates/turborepo-env/src/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,17 @@ impl PlatformEnv {
ceprintln!(
color_config,
BOLD,
"The following environment variables are set on your Vercel project, but \
missing from \"turbo.json\". {}",
"Warning - the following environment variables are set on your Vercel \
project, but missing from \"turbo.json\". {}",
strict_message
);
}
_ => {
ceprintln!(
color_config,
BOLD,
"The following environment variables are missing from \"turbo.json\". {}",
"Warning - the following environment variables are missing from \
\"turbo.json\". {}",
strict_message
);
}
Expand All @@ -94,11 +95,21 @@ impl PlatformEnv {
task_id_for_display: &str,
color_config: ColorConfig,
) {
ceprintln!(color_config, YELLOW, "{}", task_id_for_display);
let ci = Vendor::get_constant().unwrap_or("unknown");
let log_prefix = match ci {
"VERCEL" => "[warn]",
_ => "",
};
ceprintln!(
color_config,
YELLOW,
"{} {}",
log_prefix,
task_id_for_display
);
for key in missing {
ceprint!(color_config, GREY, " - ");
ceprint!(color_config, GREY, "{}\n", key);
ceprint!(color_config, GREY, "{} - ", log_prefix);
ceprint!(color_config, GREY, "{} \n", key);
}
eprintln!();
}
}

0 comments on commit 51b75dc

Please sign in to comment.