MCPcopy Index your code
hub / github.com/cargo-lambda/cargo-lambda / run

Method run

crates/cargo-lambda-new/src/lib.rs:92–110  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

90impl Init {
91 #[tracing::instrument(skip(self), target = "cargo_lambda")]
92 pub async fn run(&mut self) -> Result<()> {
93 if !self.path.is_dir() {
94 Err(CreateError::NotADirectoryPath(self.path.to_path_buf()))?;
95 }
96
97 if self.path.join("Cargo.toml").is_file() {
98 Err(CreateError::InvalidPackageRoot)?;
99 }
100
101 let path = dunce::canonicalize(&self.path).map_err(CreateError::InvalidPath)?;
102
103 let name = self
104 .name
105 .as_deref()
106 .or_else(|| path.file_name().and_then(|s| s.to_str()))
107 .ok_or_else(|| miette::miette!("invalid package name"))?;
108
109 new_project(name, &path, &mut self.config, false).await
110 }
111}
112
113#[derive(Args, Clone, Debug)]

Callers 1

mainFunction · 0.45

Calls 1

new_projectFunction · 0.85

Tested by

no test coverage detected