From ffaab771f3fb148940880738c09ba70fed951b7a Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Mon, 11 Sep 2023 13:33:09 -0700 Subject: [PATCH] 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 --- komorebic/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/komorebic/src/main.rs b/komorebic/src/main.rs index 887a9379..4b51f925 100644 --- a/komorebic/src/main.rs +++ b/komorebic/src/main.rs @@ -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")