Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add gitignore in project creation #266

Merged
merged 2 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading