(value: &str)
| 250 | } |
| 251 | |
| 252 | fn 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 | |
| 265 | fn is_remote_zip_file(path: &str) -> bool { |
| 266 | path.starts_with("https://") && path.ends_with(".zip") |