mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 22:12:53 +01:00
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:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user