pub fn start(&mut self) -> Result<()> {
        println!(
            "{}",
            "Creating new project files...".foreground(GREEN).bold()
        );

        self.name = question(format!("{}", "Project Name?".bold()).as_str(), "")?;

        // Ask the user to specify the language(s) for the project.
        let mut language_text = Vec::with_capacity(3);

        language_text.push(format!(
            "{} {}",
            "Language(s)".bold(),
            "(space delimited)?".italic()
        ));
        language_text.push(format!(
            "{}: {}",
            "  Options".dim(),
            "rust python typescript"
        ));
        language_text.push(format!("{}: {}", "  Default".dim(), "rust"));

        self.languages = question(&language_text.join("\n"), "rust")?
            .split_whitespace()
            .map(|s| s.to_string())
            .collect();

        self.author = question(format!("{}", "Author?".bold()).as_str(), "")?;

        // Ask the user to specify the license(s) for the project.
        let mut license_text = Vec::with_capacity(3);

        license_text.push(format!(
            "{} {}",
            "Licenses".bold(),
            "(space delimited)?".italic()
        ));
        license_text.push(format!("{}: {}", "  Options".dim(), "mit apache"));
        license_text.push(format!("{}: {}", "  Default".dim(), "mit"));

        self.licenses = question(&license_text.join("\n"), "mit")?
            .to_lowercase()
            .split_whitespace()
            .map(|s| s.to_string())
            .collect();

        // We want licenses to be alphabetically sorted to match template naming.
        self.licenses.sort();

        for lang in &self.languages {
            match lang.as_str() {
                "rust" | "rs" => {
                    self.generate_rust_specific_files()?;
                }
                "typescript" | "ts" => {}
                "python" | "py" => {}
                _ => {
                    println!("Unsupported language: {}", lang);
                }
            }
        }

        self.generate_licenses()?;
        self.generate_readme()?;
        self.generate_gitignore()?;
        self.generate_markdownlintignore()?;
        self.generate_changelog()?;
        self.generate_gitattributes()?;

        println!(
            "{}",
            "Project files created successfully!"
                .foreground(GREEN)
                .bold()
        );

        Ok(())
    }
/// Starts the new project creation process in the terminal.
Starts the new project creation process in the terminal.
Starts the new project creation process in the terminal .
pub fn start(&mut self) -> Result<()> {
        println!(
            "{}",
            "Creating new project files...".foreground(GREEN).bold()
        );
        self.name = question(format!("{}", "Project Name?".bold()).as_str(), "")?;
        // Ask the user to specify the language(s) for the project.
        let mut language_text = Vec::with_capacity(3);
        language_text.push(format!(
            "{} {}",
            "Language(s)".bold(),
            "(space delimited)?".italic()
        ));
        language_text.push(format!(
            "{}: {}",
            "  Options".dim(),
            "rust python typescript"
        ));
        language_text.push(format!("{}: {}", "  Default".dim(), "rust"));
        self.languages = question(&language_text.join("\n"), "rust")?
            .split_whitespace()
            .map(|s| s.to_string())
            .collect();
        self.author = question(format!("{}", "Author?".bold()).as_str(), "")?;
        // Ask the user to specify the license(s) for the project.
        let mut license_text = Vec::with_capacity(3);
        license_text.push(format!(
            "{} {}",
            "Licenses".bold(),
            "(space delimited)?".italic()
        ));
        license_text.push(format!("{}: {}", "  Options".dim(), "mit apache"));
        license_text.push(format!("{}: {}", "  Default".dim(), "mit"));
        self.licenses = question(&license_text.join("\n"), "mit")?
            .to_lowercase()
            .split_whitespace()
            .map(|s| s.to_string())
            .collect();
        // We want licenses to be alphabetically sorted to match template naming.
        self.licenses.sort();
        for lang in &self.languages {
            match lang.as_str() {
                "rust" | "rs" => {
                    self.generate_rust_specific_files()?;
                }
                "typescript" | "ts" => {}
                "python" | "py" => {}
                _ => {
                    println!("Unsupported language: {}", lang);
                }
            }
        }
        self.generate_licenses()?;
        self.generate_readme()?;
        self.generate_gitignore()?;
        self.generate_markdownlintignore()?;
        self.generate_changelog()?;
        self.generate_gitattributes()?;
        println!(
            "{}",
            "Project files created successfully!"
                .foreground(GREEN)
                .bold()
        );
        Ok(())
    }
pub fn start ( & mut self ) -> Result < ( ) > { println ! ( " " " " foreground ( GREEN ) bold ( ) ) ; self . name = question ( format ! ( " " " " bold ( ) ) . as_str ( ) , " " ) ? ; // Ask the user to specify the language(s) for the project. let mut language_text = Vec :: with_capacity ( 3 ) ; language_text . push ( format ! ( " " " " bold ( ) " " italic ( ) ) ) ; language_text . push ( format ! ( " " " " dim ( ) " " ) ) ; language_text . push ( format ! ( " " " " dim ( ) " " ) ) ; self . languages = question ( & language_text . join ( " \n " ) , " " ) ? . split_whitespace ( ) . map ( | s | s . to_string ( ) ) . collect ( ) ; self . author = question ( format ! ( " " " " bold ( ) ) . as_str ( ) , " " ) ? ; // Ask the user to specify the license(s) for the project. let mut license_text = Vec :: with_capacity ( 3 ) ; license_text . push ( format ! ( " " " " bold ( ) " " italic ( ) ) ) ; license_text . push ( format ! ( " " " " dim ( ) " " ) ) ; license_text . push ( format ! ( " " " " dim ( ) " " ) ) ; self . licenses = question ( & license_text . join ( " \n " ) , " " ) ? . to_lowercase ( ) . split_whitespace ( ) . map ( | s | s . to_string ( ) ) . collect ( ) ; // We want licenses to be alphabetically sorted to match template naming. self . licenses . sort ( ) ; for lang in & self . languages { match lang . as_str ( ) { " " | " " => { self . generate_rust_specific_files ( ) ? ; } " " | " " => { } " " | " " => { } _ => { println ! ( " " lang ) ; } } } self . generate_licenses ( ) ? ; self . generate_readme ( ) ? ; self . generate_gitignore ( ) ? ; self . generate_markdownlintignore ( ) ? ; self . generate_changelog ( ) ? ; self . generate_gitattributes ( ) ? ; println ! ( " " " " foreground ( GREEN ) bold ( ) ) ; Ok ( ( ) ) }
Starts the new project creation process in the terminal.
Starts the new project creation process in the terminal .
&mut self
&mut self