Skip to content

Commit

Permalink
fix: kalba not building on windows due to mutability problem
Browse files Browse the repository at this point in the history
BrewingWeasel committed Aug 18, 2024
1 parent f62d9f2 commit 12a73db
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src-tauri/src/setup_stanza.rs
Original file line number Diff line number Diff line change
@@ -16,18 +16,23 @@ pub async fn check_stanza_installed(state: State<'_, KalbaState>) -> Result<bool
Ok(data_dir.exists() && !state.to_save.installing_stanza)
}

#[cfg(target_os = "windows")]
fn new_command<S>(executable: S) -> Command
where
S: AsRef<std::ffi::OsStr>,
{
let cmd = Command::new(executable);
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW constant
}
let mut cmd = Command::new(executable);
use std::os::windows::process::CommandExt;
cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW constant
cmd
}
#[cfg(not(target_os = "windows"))]
fn new_command<S>(executable: S) -> Command
where
S: AsRef<std::ffi::OsStr>,
{
Command::new(executable)
}

#[tauri::command]
pub async fn setup_stanza(state: State<'_, KalbaState>, window: Window) -> Result<(), KalbaError> {

0 comments on commit 12a73db

Please sign in to comment.