Skip to content

Commit

Permalink
feat(cli): allow template version and fix CI (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstam authored Jul 2, 2024
1 parent 61d8947 commit 324f025
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
- name: Run cargo prove new
run: |
cargo prove new fibonacci
cargo prove new fibonacci --version dev
- name: Build program and run script
run: |
Expand Down
8 changes: 7 additions & 1 deletion cli/src/commands/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ pub struct NewCmd {
/// Whether to create the project with template EVM contracts.
#[arg(long, action)]
evm: bool,

/// Version of sp1-project-template to use (branch or tag).
#[arg(long, default_value = "main")]
version: String,
}

const TEMPLATE_REPOSITORY_URL: &str = "https://github.com/succinctlabs/sp1-project-template";
Expand All @@ -25,9 +29,11 @@ impl NewCmd {
fs::create_dir(&self.name)?;
}

// Clone the repository.
// Clone the repository with the specified version.
let output = Command::new("git")
.arg("clone")
.arg("--branch")
.arg(&self.version)
.arg(TEMPLATE_REPOSITORY_URL)
.arg(root.as_os_str())
.arg("--recurse-submodules")
Expand Down

0 comments on commit 324f025

Please sign in to comment.