Skip to content

Commit

Permalink
init: Handle option --dry-run (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
aawsome authored Oct 12, 2023
1 parent 73d6b20 commit 4eb3257
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/commands/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ impl InitCmd {
bail!("Config file already exists. Aborting.");
}

// Handle dry-run mode
if config.global.dry_run {
bail!(
"cannot initialize repository {} in dry-run mode!",
repo.name
);
}

let _ = init(repo, &self.key_opts, &self.config_opts)?;
Ok(())
}
Expand Down

0 comments on commit 4eb3257

Please sign in to comment.