Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
--dev implies --tmp (#9938)
Browse files Browse the repository at this point in the history
* `--dev` implies `--tmp`

This changes `--dev` to imply `--tmp` when no explicit `--base-path` is provided.

* Update client/cli/src/commands/run_cmd.rs

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
  • Loading branch information
bkchr and apopiak authored Oct 6, 2021
1 parent 2a6e826 commit 669045f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/cli/src/commands/run_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ pub struct RunCmd {
///
/// Note: the directory is random per process execution. This directory is used as base path
/// which includes: database, node key and keystore.
///
/// When `--dev` is given and no explicit `--base-path`, this option is implied.
#[structopt(long, conflicts_with = "base-path")]
pub tmp: bool,
}
Expand Down Expand Up @@ -444,7 +446,12 @@ impl CliConfiguration for RunCmd {
Ok(if self.tmp {
Some(BasePath::new_temp_dir()?)
} else {
self.shared_params().base_path()
match self.shared_params().base_path() {
Some(r) => Some(r),
// If `dev` is enabled, we use the temp base path.
None if self.shared_params().is_dev() => Some(BasePath::new_temp_dir()?),
None => None,
}
})
}
}
Expand Down

0 comments on commit 669045f

Please sign in to comment.