From 6f40318ca2f9f30445440e0fd84dda89e0bfad3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Wed, 6 Oct 2021 11:20:21 +0200 Subject: [PATCH] `--dev` implies `--tmp` (#9938) * `--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 --- substrate/client/cli/src/commands/run_cmd.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/substrate/client/cli/src/commands/run_cmd.rs b/substrate/client/cli/src/commands/run_cmd.rs index 98f2090c6f..b43135f109 100644 --- a/substrate/client/cli/src/commands/run_cmd.rs +++ b/substrate/client/cli/src/commands/run_cmd.rs @@ -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, } @@ -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, + } }) } }