refactor: cleanup main.rs (#16996)

1. Extracts out some code from main.rs
2. Inlines all the `x_command` functions in main.rs
This commit is contained in:
David Sherret 2022-12-09 09:40:48 -05:00 committed by GitHub
parent 9daf6e197a
commit 6541a0a9fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 664 additions and 760 deletions

View file

@ -13,6 +13,7 @@ use deno_ast::MediaType;
use deno_ast::ModuleSpecifier;
use deno_core::anyhow::anyhow;
use deno_core::anyhow::Context;
use deno_core::error::generic_error;
use deno_core::error::AnyError;
use deno_core::serde_json;
use deno_core::sourcemap::SourceMap;
@ -608,6 +609,10 @@ pub async fn cover_files(
flags: Flags,
coverage_flags: CoverageFlags,
) -> Result<(), AnyError> {
if coverage_flags.files.is_empty() {
return Err(generic_error("No matching coverage profiles found"));
}
let ps = ProcState::build(flags).await?;
let script_coverages =