Skip to content

Commit

Permalink
Merge pull request #495 from primitivefinance/bug_init
Browse files Browse the repository at this point in the history
rename package upon project initialization
  • Loading branch information
Autoparallel authored Sep 14, 2023
2 parents 78af90f + 692fda3 commit a63d62d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exclude = ["benches"]
# Package configuration
[package]
name = "arbiter"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
authors = ["Colin Roberts", "Waylon Jepsen"]

Expand Down
8 changes: 7 additions & 1 deletion bin/init.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{env, io, process::Command};
use std::{env, fs, io, process::Command};

/// Initializes a new Arbiter project from a template.
///
Expand Down Expand Up @@ -42,6 +42,12 @@ pub(crate) fn init_project(name: &str) -> io::Result<()> {
}

env::set_current_dir(name)?;

let mut cargo_toml_content = fs::read_to_string("Cargo.toml")?;
cargo_toml_content = cargo_toml_content.replace("arbiter_template", name);
// Write the modified Cargo.toml back to disk
fs::write("Cargo.toml", cargo_toml_content)?;

let install_output = Command::new("forge").arg("install").output()?;

if install_output.status.success() {
Expand Down

0 comments on commit a63d62d

Please sign in to comment.