Removing git init and git add entirely per conversation on PR
use std::io::Write;
use std::path::PathBuf;
-use std::process::Command;
pub(crate) fn create_crate_template(
path: PathBuf,
@@ -22,8 +21,7 @@ pub(crate) fn create_crate_template(
crate::generate_schema()?;
std::env::set_current_dir(cwd)?;
- git_init(&path)?;
- git_add(&path)
+ Ok(())
}
fn create_directory_structure(path: &PathBuf) -> Result<(), std::io::Error> {
@@ -104,34 +102,3 @@ fn create_git_ignore(path: &PathBuf, _name: &str) -> Result<(), std::io::Error>
Ok(())
}
-fn git_init(path: &PathBuf) -> Result<(), std::io::Error> {
- let output = Command::new("git")
- .arg("init")
- .arg(".")
- .current_dir(path)
- .output()?;
-
- if !output.status.success() {
- Err(std::io::Error::from_raw_os_error(
- output.status.code().unwrap(),
- ))
- } else {
- Ok(())
- }
-}
-
-fn git_add(path: &PathBuf) -> Result<(), std::io::Error> {
- let output = Command::new("git")
- .arg("add")
- .arg(".")
- .current_dir(path)
- .output()?;
-
- if !output.status.success() {
- Err(std::io::Error::from_raw_os_error(
- output.status.code().unwrap(),
- ))
- } else {
- Ok(())
- }
-}
