MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / run

Method run

atomic-cli/src/commands/clone/command.rs:1436–1450  ·  view source on GitHub ↗

Execute the clone command. This method creates a tokio runtime and executes the async clone operation. It handles all the steps required to create a local copy of a remote repository. # Errors Returns an error if: - The target directory already exists - The remote cannot be connected to - Network operations fail - Changes fail to download or save

(&self)

Source from the content-addressed store, hash-verified

1434 /// - Network operations fail
1435 /// - Changes fail to download or save
1436 fn run(&self) -> CliResult<()> {
1437 // Validate URL is not empty
1438 if self.url.is_empty() {
1439 return Err(CliError::InvalidArgument {
1440 message: "Repository URL is required".to_string(),
1441 });
1442 }
1443
1444 // Create a runtime for async operations
1445 let rt = tokio::runtime::Runtime::new().map_err(|e| {
1446 CliError::Internal(anyhow::anyhow!("Failed to create async runtime: {}", e))
1447 })?;
1448
1449 rt.block_on(self.run_async())
1450 }
1451}
1452
1453// Tests

Callers 1

test_run_empty_urlFunction · 0.45

Calls 2

is_emptyMethod · 0.45
run_asyncMethod · 0.45

Tested by 1

test_run_empty_urlFunction · 0.36