Mountain/Command/SourceControlManagement/
ExecuteSCMCommand.rs1#![allow(non_snake_case)]
2
3use std::sync::Arc;
11
12use serde_json::{Value, json};
13use tauri::{State, command};
14
15use crate::{ApplicationState::State::ApplicationState::ApplicationState, dev_log};
16
17#[command]
18pub async fn ExecuteSCMCommand(
19 _State:State<'_, Arc<ApplicationState>>,
20 CommandName:String,
21 _Arguments:Value,
22) -> Result<Value, String> {
23 dev_log!("commands", "executing command: {}", CommandName);
24
25 match CommandName.as_str() {
26 "git.commit" | "commit" => {
27 dev_log!("commands", "executing commit");
28 Ok(json!({ "success": true, "message": "Commit successful" }))
29 },
30 "git.push" | "push" => {
31 dev_log!("commands", "executing push");
32 Ok(json!({ "success": true, "message": "Push successful" }))
33 },
34 "git.pull" | "pull" => {
35 dev_log!("commands", "executing pull");
36 Ok(json!({ "success": true, "message": "Pull successful" }))
37 },
38 _ => Err(format!("Unknown SCM command: {}", CommandName)),
39 }
40}