From e25b6135c45ceabcd5c2d5738e2c9a6e06f292c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?1024=E5=B0=8F=E7=A5=9E?= <15670339118@163.com> Date: Sun, 22 Sep 2024 15:23:26 +0800 Subject: [PATCH] update build.yml --- src-tauri/src/command/preview.rs | 4 ++-- src/pages/home.vue | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/command/preview.rs b/src-tauri/src/command/preview.rs index 75cb9321..bd98f9b4 100644 --- a/src-tauri/src/command/preview.rs +++ b/src-tauri/src/command/preview.rs @@ -32,7 +32,7 @@ pub async fn read_json_file(handle: tauri::AppHandle) -> String { } #[tauri::command] -pub async fn update_build_file(handle: tauri::AppHandle, branch: String) -> String { +pub async fn update_build_file(handle: tauri::AppHandle) -> String { let resource_path = handle .path_resolver() .resolve_resource("data/appbuild.yml") @@ -40,7 +40,7 @@ pub async fn update_build_file(handle: tauri::AppHandle, branch: String) -> Stri let mut build_file = std::fs::File::open(&resource_path).unwrap(); let mut contents = String::new(); build_file.read_to_string(&mut contents).unwrap(); - contents = contents.replace("PROJECTNAME", branch.as_str()); + // contents = contents.replace("PROJECTNAME", branch.as_str()); // println!("Updated build file: {}", contents); // The new file content, using Base64 encoding let encoded_contents = BASE64_STANDARD.encode(contents); diff --git a/src/pages/home.vue b/src/pages/home.vue index 0072ec81..f97d0166 100644 --- a/src/pages/home.vue +++ b/src/pages/home.vue @@ -253,16 +253,14 @@ const updateBuildYml = async () => { console.log('get build.yml file sha', shaRes) if (shaRes.status === 200) { // get build.yml file content - const content = await invoke('update_build_file', { - branch: branchName.value, - }) + const content = await invoke('update_build_file') console.log('content', content) // update build.yml file content const updateRes: any = await githubApi.updateBuildYmlFile( store.userInfo.login, 'PakePlus', { - message: 'update from pakeplus', + message: 'update build.yml from pakeplus', content: content, sha: shaRes.data.sha, branch: branchName.value,