mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 08:33:43 -05:00
chore: hidden tool for overwriting files with fast check output (#22822)
Not sure if we should do this, but it's a nice hidden tool that overwrites the working tree with the fast check output.
This commit is contained in:
parent
badb42fc23
commit
644ac0fe43
1 changed files with 21 additions and 0 deletions
|
@ -837,6 +837,27 @@ async fn build_and_check_graph_for_publish(
|
||||||
colors::yellow("Warning"),
|
colors::yellow("Warning"),
|
||||||
);
|
);
|
||||||
Ok(Arc::new(graph))
|
Ok(Arc::new(graph))
|
||||||
|
} else if std::env::var("DENO_INTERNAL_FAST_CHECK_OVERWRITE").is_ok() {
|
||||||
|
if check_if_git_repo_dirty(cli_options.initial_cwd()).await {
|
||||||
|
bail!("When using DENO_INTERNAL_FAST_CHECK_OVERWRITE, the git repo must be in a clean state.");
|
||||||
|
}
|
||||||
|
|
||||||
|
for module in graph.modules() {
|
||||||
|
if module.specifier().scheme() != "file" {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
let Some(js) = module.js() else {
|
||||||
|
continue;
|
||||||
|
};
|
||||||
|
if let Some(module) = js.fast_check_module() {
|
||||||
|
std::fs::write(
|
||||||
|
js.specifier.to_file_path().unwrap(),
|
||||||
|
module.source.as_ref(),
|
||||||
|
)?;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bail!("Exiting due to DENO_INTERNAL_FAST_CHECK_OVERWRITE")
|
||||||
} else {
|
} else {
|
||||||
log::info!("Checking for slow types in the public API...");
|
log::info!("Checking for slow types in the public API...");
|
||||||
let mut any_pkg_had_diagnostics = false;
|
let mut any_pkg_had_diagnostics = false;
|
||||||
|
|
Loading…
Reference in a new issue