fix(cli): remedy regression in start cmd

This commit remedies a regression noticed by user @notkvwu in #493,
which results in 'komorebic start' failing, due to an empty ArgumentList
being passed to the PS Start-Process command.

This has been fixed by ensuring that the ArgumentList is only passed
when the user has specified flags on the start command.

fix #493
This commit is contained in:
LGUG2Z
2023-09-11 13:33:09 -07:00
parent 710a8d76ea
commit ffaab771f3

View File

@@ -1468,8 +1468,13 @@ fn main() -> Result<()> {
flags.push(format!("'--tcp-port={port}'"));
}
let argument_list = flags.join(",");
let script = {
let script = if flags.is_empty() {
format!(
"Start-Process '{}' -WindowStyle hidden",
exec.unwrap_or("komorebi.exe")
)
} else {
let argument_list = flags.join(",");
format!(
"Start-Process '{}' -ArgumentList {argument_list} -WindowStyle hidden",
exec.unwrap_or("komorebi.exe")