fix(cli): respect --bar flag in start even when no config is resolved

I think this got broken as part of the automatic Rust version syntax
upgrades which joined two if clauses together with && which should have
been kept separate.

Now, if the user gives the --bar flag to the start command, and a static
config file is not resolved, or if the static config file does not have
a bar_configurations stanza, it will fallthrough to the default
PowerShell snippet to try and start komorebi-bar without an explicit
--config flag.
This commit is contained in:
LGUG2Z
2026-01-03 16:55:56 -08:00
parent 51e1337f40
commit 086993a7c0

View File

@@ -2520,9 +2520,13 @@ if (!(Get-Process whkd -ErrorAction SilentlyContinue))
komorebi_json.is_file().then_some(komorebi_json)
});
if args.bar
&& let Some(config) = &static_config
{
if args.bar {
let mut fallthrough = false;
match static_config {
None => {
fallthrough = true;
}
Some(ref config) => {
let mut config = StaticConfig::read(config)?;
if let Some(display_bar_configurations) = &mut config.bar_configurations {
for config_file_path in &mut *display_bar_configurations {
@@ -2541,6 +2545,12 @@ if (!(Get-Process whkd -ErrorAction SilentlyContinue))
}
}
} else {
fallthrough = true;
}
}
}
if fallthrough {
let script = r"
if (!(Get-Process komorebi-bar -ErrorAction SilentlyContinue))
{