diff --git a/cli/src/assets/.gitignore b/cli/src/assets/.gitignore new file mode 100644 index 0000000000..0be6e7269a --- /dev/null +++ b/cli/src/assets/.gitignore @@ -0,0 +1,16 @@ +# Cargo build +**/target + +# Cargo config +.cargo + +# Profile-guided optimization +/tmp +pgo-data.profdata + +# MacOS nuisances +.DS_Store + +# Proofs +**/proof-with-pis.json +**/proof-with-io.json diff --git a/cli/src/commands/new.rs b/cli/src/commands/new.rs index 376b1a3654..9125417b59 100644 --- a/cli/src/commands/new.rs +++ b/cli/src/commands/new.rs @@ -8,6 +8,7 @@ const PROGRAM_MAIN_RS: &str = include_str!("../assets/program/main.rs"); const SCRIPT_CARGO_TOML: &str = include_str!("../assets/script/Cargo.toml"); const SCRIPT_MAIN_RS: &str = include_str!("../assets/script/main.rs"); const SCRIPT_RUST_TOOLCHAIN: &str = include_str!("../assets/script/rust-toolchain"); +const GIT_IGNORE: &str = include_str!("../assets/.gitignore"); #[derive(Parser)] #[command(name = "new", about = "Setup a new project that runs inside the SP1.")] @@ -44,6 +45,9 @@ impl NewCmd { fs::write(script_root.join("src").join("main.rs"), SCRIPT_MAIN_RS)?; fs::write(script_root.join("rust-toolchain"), SCRIPT_RUST_TOOLCHAIN)?; + // Add .gitignore file to root. + fs::write(root.join(".gitignore"), GIT_IGNORE)?; + println!( " \x1b[1m{}\x1b[0m {} ({})", Paint::green("Initialized"),