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

Add cairo-test plugin to Scarb.toml manifest on new #1372

Merged
merged 1 commit into from
Jun 19, 2024
Merged
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
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
Loading