fn generate_readme(&self) -> Result<()> {
        let readme_template = if self.licenses.len() > 1 {
            format!("{}{}", &self.licenses.join("_"), "_readme")
        } else {
            "readme".to_string()
        };

        let template_path = get_template_path(&readme_template)
            .with_context(|| format!("Template `{}.txt` does not exist.", &readme_template))?;

        let template_file = read_to_string(template_path)?;
        let formatted_file = self.search_and_replace(template_file);
        let mut output = create_file("README.md")?;

        output.write_all(formatted_file.as_bytes())?;

        Ok(())
    }
/// Generates a README.md file for the project.
Generates a README.md file for the project.
Generates a README . md file for the project .
fn generate_readme(&self) -> Result<()> {
        let readme_template = if self.licenses.len() > 1 {
            format!("{}{}", &self.licenses.join("_"), "_readme")
        } else {
            "readme".to_string()
        };
        let template_path = get_template_path(&readme_template)
            .with_context(|| format!("Template `{}.txt` does not exist.", &readme_template))?;
        let template_file = read_to_string(template_path)?;
        let formatted_file = self.search_and_replace(template_file);
        let mut output = create_file("README.md")?;
        output.write_all(formatted_file.as_bytes())?;
        Ok(())
    }
fn generate_readme ( & self ) -> Result < ( ) > { let readme_template = if self . licenses . len ( ) > 1 { format ! ( " " self licenses join ( " " ) " " ) } else { " " . to_string ( ) } ; let template_path = get_template_path ( & readme_template ) . with_context ( | | format ! ( " " readme_template ) ) ? ; let template_file = read_to_string ( template_path ) ? ; let formatted_file = self . search_and_replace ( template_file ) ; let mut output = create_file ( " " ) ? ; output . write_all ( formatted_file . as_bytes ( ) ) ? ; Ok ( ( ) ) }
Generates a README.md file for the project.
Generates a README . md file for the project .
&self
&self