mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +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,27 +2520,37 @@ if (!(Get-Process whkd -ErrorAction SilentlyContinue))
|
|||||||
komorebi_json.is_file().then_some(komorebi_json)
|
komorebi_json.is_file().then_some(komorebi_json)
|
||||||
});
|
});
|
||||||
|
|
||||||
if args.bar
|
if args.bar {
|
||||||
&& let Some(config) = &static_config
|
let mut fallthrough = false;
|
||||||
{
|
match static_config {
|
||||||
let mut config = StaticConfig::read(config)?;
|
None => {
|
||||||
if let Some(display_bar_configurations) = &mut config.bar_configurations {
|
fallthrough = true;
|
||||||
for config_file_path in &mut *display_bar_configurations {
|
}
|
||||||
let script = format!(
|
Some(ref config) => {
|
||||||
r#"Start-Process "komorebi-bar" '"--config" "{}"' -WindowStyle hidden"#,
|
let mut config = StaticConfig::read(config)?;
|
||||||
config_file_path.to_string_lossy()
|
if let Some(display_bar_configurations) = &mut config.bar_configurations {
|
||||||
);
|
for config_file_path in &mut *display_bar_configurations {
|
||||||
|
let script = format!(
|
||||||
|
r#"Start-Process "komorebi-bar" '"--config" "{}"' -WindowStyle hidden"#,
|
||||||
|
config_file_path.to_string_lossy()
|
||||||
|
);
|
||||||
|
|
||||||
match powershell_script::run(&script) {
|
match powershell_script::run(&script) {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
println!("{script}");
|
println!("{script}");
|
||||||
}
|
}
|
||||||
Err(error) => {
|
Err(error) => {
|
||||||
println!("Error: {error}");
|
println!("Error: {error}");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
fallthrough = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if fallthrough {
|
||||||
let script = r"
|
let script = r"
|
||||||
if (!(Get-Process komorebi-bar -ErrorAction SilentlyContinue))
|
if (!(Get-Process komorebi-bar -ErrorAction SilentlyContinue))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user