Skip to content

Commit

Permalink
Add cairo-test plugin to Scarb.toml manifest on new (#1372)
Browse files Browse the repository at this point in the history
  • Loading branch information
maciektr authored Jun 19, 2024
1 parent ff85d09 commit 0750a15
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scarb/src/ops/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use crate::internal::fsx;
use crate::internal::restricted_names;
use crate::subcommands::get_env_vars;
use crate::{ops, DEFAULT_SOURCE_PATH, DEFAULT_TARGET_DIR_NAME, MANIFEST_FILE_NAME};
use scarb_build_metadata::SCARB_VERSION;
use std::process::{Command, Stdio};

#[derive(Clone, Copy, Debug, PartialEq)]
Expand Down Expand Up @@ -141,6 +142,15 @@ fn mk(
// Create the `Scarb.toml` file.
let manifest_path = canonical_path.join(MANIFEST_FILE_NAME);
let edition = edition_variant(Edition::latest());
let dev_deps = if snforge {
String::new()
} else {
formatdoc! {r#"
[dev-dependencies]
cairo_test = "{SCARB_VERSION}"
"#}
};
fsx::write(
&manifest_path,
formatdoc! {r#"
Expand All @@ -152,7 +162,7 @@ fn mk(
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html
[dependencies]
"#},
"#} + &dev_deps,
)?;

// Create hello world source files (with respective parent directories) if none exist.
Expand Down

0 comments on commit 0750a15

Please sign in to comment.