Skip to content

Commit

Permalink
feat: add gitignore in project creation (#266)
Browse files Browse the repository at this point in the history
Co-authored-by: John Guibas <[email protected]>
  • Loading branch information
kayleegeorge and John Guibas authored Feb 18, 2024
1 parent d1f9a74 commit 8ac9e54
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions cli/src/assets/.gitignore
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions cli/src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.")]
Expand Down Expand Up @@ -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"),
Expand Down

0 comments on commit 8ac9e54

Please sign in to comment.