MCPcopy Create free account
hub / github.com/cargo-lambda/cargo-lambda / find_local_directory

Function find_local_directory

crates/cargo-lambda-new/src/template.rs:252–263  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

250}
251
252fn find_local_directory(value: &str) -> Result<PathBuf> {
253 let path = dunce::realpath(value)
254 .map_err(|err| miette::miette!("invalid template option {value}: {err}"))?;
255
256 if path.is_dir() {
257 Ok(path)
258 } else {
259 Err(miette::miette!(
260 "invalid template option {value}: No such directory"
261 ))
262 }
263}
264
265fn is_remote_zip_file(path: &str) -> bool {
266 path.starts_with("https://") && path.ends_with(".zip")

Callers 1

try_fromMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected