Skip to main content

scaffold

Function scaffold 

Source
pub fn scaffold(root: &Path, name: &str) -> Result<(PathBuf, String)>
Expand description

Write a runnable plugin skeleton for name into a new directory under root, named by scaffold_keyword. Returns the directory and the keyword.

Refuses to touch a directory that already exists — a scaffolder that can overwrite a real plugin is a footgun, not a convenience. name is arbitrary user text, so it reaches the manifest as an escaped TOML string and the script as a quoted shell variable, never as syntax.

§Errors

std::io::ErrorKind::InvalidInput if name yields no usable directory name, std::io::ErrorKind::AlreadyExists if the directory is already there, and any I/O error from creating the directory or writing the files in it.