1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 04:52:26 -05:00

remote CliFactoryWithWorkspaceFiles::initial_cwd()

This commit is contained in:
Nayeem Rahman 2025-01-20 09:35:28 +00:00
parent 1e073ee1d6
commit 1dd361492d
2 changed files with 4 additions and 11 deletions

View file

@ -1245,7 +1245,6 @@ pub struct CliFactoryWithWorkspaceFiles {
pub cli_options: Arc<CliOptions>,
file_specifiers: Vec<ModuleSpecifier>,
doc_snippet_specifiers: Vec<ModuleSpecifier>,
initial_cwd: PathBuf,
}
impl CliFactoryWithWorkspaceFiles {
@ -1275,7 +1274,6 @@ impl CliFactoryWithWorkspaceFiles {
));
let mut factory = CliFactory::from_cli_options(cli_options.clone());
factory.watcher_communicator = watcher_communicator.cloned();
let initial_cwd = cli_options.initial_cwd().to_path_buf();
if let Some(watcher_communicator) = watcher_communicator {
let _ = watcher_communicator.watch_paths(cli_options.watch_paths());
}
@ -1322,14 +1320,9 @@ impl CliFactoryWithWorkspaceFiles {
cli_options,
file_specifiers,
doc_snippet_specifiers,
initial_cwd,
})
}
pub fn initial_cwd(&self) -> &PathBuf {
&self.initial_cwd
}
pub fn found_specifiers(&self) -> bool {
!self.file_specifiers.is_empty() || !self.doc_snippet_specifiers.is_empty()
}

View file

@ -1527,7 +1527,7 @@ pub async fn run_tests(
return Ok(());
}
let initial_cwd = factory.initial_cwd();
let initial_cwd = factory.cli_options.initial_cwd();
test_specifiers(
&factory,
None,
@ -1535,7 +1535,7 @@ pub async fn run_tests(
cwd: Url::from_directory_path(initial_cwd).map_err(|_| {
anyhow!(
"Unable to construct URL from the path of cwd: {}",
factory.cli_options.initial_cwd().to_string_lossy(),
initial_cwd.to_string_lossy(),
)
})?,
concurrent_jobs: test_flags
@ -1623,7 +1623,7 @@ pub async fn run_tests_with_watch(
return Ok(());
}
let initial_cwd = factory.initial_cwd();
let initial_cwd = factory.cli_options.initial_cwd();
test_specifiers(
&factory,
changed_paths.map(|p| p.into_iter().collect()).as_ref(),
@ -1631,7 +1631,7 @@ pub async fn run_tests_with_watch(
cwd: Url::from_directory_path(initial_cwd).map_err(|_| {
anyhow!(
"Unable to construct URL from the path of cwd: {}",
factory.cli_options.initial_cwd().to_string_lossy(),
initial_cwd.to_string_lossy(),
)
})?,
concurrent_jobs: test_flags