From 9114a2df69da9318c4e10887553b7daf77b0fa16 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 23 Jul 2024 19:00:48 -0400 Subject: fix(upgrade): do not error if config in cwd invalid (#24689) ``` > deno upgrade error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile. V:\scratch > V:\deno\target\debug\deno upgrade Looking up latest version Local deno version 1.45.3 is the most recent release ``` Closes #24517 Closes #20729 --- cli/tools/lint/mod.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'cli/tools/lint') diff --git a/cli/tools/lint/mod.rs b/cli/tools/lint/mod.rs index 3b2af12fb..942129120 100644 --- a/cli/tools/lint/mod.rs +++ b/cli/tools/lint/mod.rs @@ -76,7 +76,10 @@ fn create_reporter(kind: LintReporterKind) -> Box { } } -pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> { +pub async fn lint( + flags: Arc, + lint_flags: LintFlags, +) -> Result<(), AnyError> { if let Some(watch_flags) = &lint_flags.watch { if lint_flags.is_stdin() { return Err(generic_error( @@ -89,8 +92,8 @@ pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> { move |flags, watcher_communicator, changed_paths| { let lint_flags = lint_flags.clone(); Ok(async move { - let factory = CliFactory::from_flags(flags)?; - let cli_options = factory.cli_options(); + let factory = CliFactory::from_flags(flags); + let cli_options = factory.cli_options()?; let lint_config = cli_options.resolve_deno_lint_config()?; let mut paths_with_options_batches = resolve_paths_with_options_batches(cli_options, &lint_flags)?; @@ -140,8 +143,8 @@ pub async fn lint(flags: Flags, lint_flags: LintFlags) -> Result<(), AnyError> { ) .await?; } else { - let factory = CliFactory::from_flags(flags)?; - let cli_options = factory.cli_options(); + let factory = CliFactory::from_flags(flags); + let cli_options = factory.cli_options()?; let is_stdin = lint_flags.is_stdin(); let deno_lint_config = cli_options.resolve_deno_lint_config()?; let workspace_lint_options = -- cgit v1.2.3