Prevent Windows console window for yaaknode and yaakprotoc

Add new_xplatform_command() helper in yaak-common that creates a
tokio::process::Command with CREATE_NO_WINDOW flag set on Windows.

Also converts git commands to async for consistency.
This commit is contained in:
Gregory Schier
2026-01-11 15:07:56 -08:00
parent 72a7e6963d
commit 42143249a2
15 changed files with 102 additions and 69 deletions

View File

@@ -6,11 +6,10 @@ use crate::error::Result;
use std::path::{Path, PathBuf};
use tauri::command;
use yaak_git::{
GitCommit, GitRemote, GitStatusSummary, PullResult, PushResult,
git_add, git_add_credential, git_add_remote, git_checkout_branch, git_commit,
git_create_branch, git_delete_branch, git_fetch_all, git_init, git_log,
git_merge_branch, git_pull, git_push, git_remotes, git_rm_remote, git_status,
git_unstage,
GitCommit, GitRemote, GitStatusSummary, PullResult, PushResult, git_add, git_add_credential,
git_add_remote, git_checkout_branch, git_commit, git_create_branch, git_delete_branch,
git_fetch_all, git_init, git_log, git_merge_branch, git_pull, git_push, git_remotes,
git_rm_remote, git_status, git_unstage,
};
// NOTE: All of these commands are async to prevent blocking work from locking up the UI
@@ -52,22 +51,22 @@ pub async fn cmd_git_initialize(dir: &Path) -> Result<()> {
#[command]
pub async fn cmd_git_commit(dir: &Path, message: &str) -> Result<()> {
Ok(git_commit(dir, message)?)
Ok(git_commit(dir, message).await?)
}
#[command]
pub async fn cmd_git_fetch_all(dir: &Path) -> Result<()> {
Ok(git_fetch_all(dir)?)
Ok(git_fetch_all(dir).await?)
}
#[command]
pub async fn cmd_git_push(dir: &Path) -> Result<PushResult> {
Ok(git_push(dir)?)
Ok(git_push(dir).await?)
}
#[command]
pub async fn cmd_git_pull(dir: &Path) -> Result<PullResult> {
Ok(git_pull(dir)?)
Ok(git_pull(dir).await?)
}
#[command]