fix(sessions): attach --create regression (#2247)
* fix(sessions): get attach --create working * style(fmt): rustfmt
This commit is contained in:
parent
5cb3fb4ad2
commit
0fc778210b
1 changed files with 5 additions and 1 deletions
|
|
@ -352,7 +352,11 @@ pub(crate) fn start_client(opts: CliArgs) {
|
||||||
let client = if let Some(idx) = index {
|
let client = if let Some(idx) = index {
|
||||||
attach_with_session_index(config_options.clone(), idx, create)
|
attach_with_session_index(config_options.clone(), idx, create)
|
||||||
} else {
|
} else {
|
||||||
if create {
|
let session_exists = session_name
|
||||||
|
.as_ref()
|
||||||
|
.and_then(|s| session_exists(&s).ok())
|
||||||
|
.unwrap_or(false);
|
||||||
|
if create && !session_exists {
|
||||||
session_name.clone().map(start_client_plan);
|
session_name.clone().map(start_client_plan);
|
||||||
}
|
}
|
||||||
attach_with_session_name(session_name, config_options.clone(), create)
|
attach_with_session_name(session_name, config_options.clone(), create)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue