Skip to content

Commit

Permalink
Pass pkg parent to snforge init (#1374)
Browse files Browse the repository at this point in the history
It seems that's what is expected there
https://github.com/foundry-rs/starknet-foundry/blob/74da40441b7bf51582fc053dcc4d4d751bef1f44/crates/forge/src/init.rs#L104

Also, I've submitted a PR in snforge repo that sets correct manifest
paths in scarb new
foundry-rs/starknet-foundry#2223
  • Loading branch information
maciektr authored Jun 20, 2024
1 parent 98c32c7 commit e4fea98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scarb/src/ops/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,19 @@ fn mk(
}

if snforge {
init_snforge(name, path, config)?;
init_snforge(name, canonical_path, config)?;
}

Ok(())
}

fn init_snforge(name: PackageName, target_dir: Utf8PathBuf, config: &Config) -> Result<()> {
let target_dir = target_dir.parent().context("package must have a parent")?;
let mut process = Command::new("snforge")
.arg("init")
.arg(name.as_str())
.current_dir(fsx::canonicalize_utf8(&target_dir)?)
.envs(get_env_vars(config, Some(target_dir))?)
.current_dir(target_dir)
.envs(get_env_vars(config, None)?)
.stderr(Stdio::inherit())
.stdout(Stdio::inherit())
.spawn()?;
Expand Down

0 comments on commit e4fea98

Please sign in to comment.