Skip to content

Commit

Permalink
rename plan to dry_run and revert name related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lambda-0x committed Jan 21, 2024
1 parent 5225c23 commit 8f1ffb6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions crates/sozo/src/commands/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ use crate::ops::migration;
pub struct MigrateArgs {
#[arg(short, long)]
#[arg(help = "Perform a dry run and outputs the plan to be executed.")]
// TODO: i think dry_run would be more descriptive
pub plan: bool,
pub dry_run: bool,

Check warning on line 17 in crates/sozo/src/commands/migrate.rs

View check run for this annotation

Codecov / codecov/patch

crates/sozo/src/commands/migrate.rs#L17

Added line #L17 was not covered by tests

#[arg(long)]
#[arg(help = "Name of the World.")]
Expand All @@ -37,9 +36,16 @@ pub struct MigrateArgs {
}

impl MigrateArgs {
pub fn run(self, config: &Config) -> Result<()> {
pub fn run(mut self, config: &Config) -> Result<()> {
let ws = scarb::ops::read_workspace(config.manifest_path(), config)?;

// If `name` was not specified use package name from `Scarb.toml` file if it exists
if self.name.is_none() {
if let Some(root_package) = ws.root_package() {
self.name = Some(root_package.id.name.to_string());
}
}

let target_dir = ws.target_dir().path_existent().unwrap();
let target_dir = target_dir.join(ws.config().profile().as_str());

Expand Down

0 comments on commit 8f1ffb6

Please sign in to comment.