Sfoglia il codice sorgente

chore: refactor tauri gen files path

nathan 2 anni fa
parent
commit
d2db49efab

+ 1 - 2
frontend/rust-lib/flowy-codegen/src/protobuf_file/mod.rs

@@ -101,8 +101,7 @@ fn generate_ts_protobuf_files(
     protoc_bin_path: &Path,
     protoc_bin_path: &Path,
 ) {
 ) {
     let root = std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap_or("../../".to_string());
     let root = std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap_or("../../".to_string());
-    let tauri_protobuf_path =
-        std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap_or("appflowy_tauri/src/protobuf".to_string());
+    let tauri_protobuf_path = std::env::var("TAURI_PROTOBUF_PATH").unwrap_or("appflowy_tauri/src/protobuf".to_string());
 
 
     let mut output = PathBuf::new();
     let mut output = PathBuf::new();
     output.push(root);
     output.push(root);

+ 1 - 2
frontend/rust-lib/flowy-codegen/src/ts_event/mod.rs

@@ -14,8 +14,7 @@ use walkdir::WalkDir;
 
 
 pub fn gen(crate_name: &str) {
 pub fn gen(crate_name: &str) {
     let root = std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap_or("../../".to_string());
     let root = std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap_or("../../".to_string());
-    let tauri_protobuf_path =
-        std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap_or("appflowy_tauri/src/protobuf".to_string());
+    let tauri_protobuf_path = std::env::var("TAURI_PROTOBUF_PATH").unwrap_or("appflowy_tauri/src/protobuf".to_string());
 
 
     let crate_path = std::fs::canonicalize(".").unwrap().as_path().display().to_string();
     let crate_path = std::fs::canonicalize(".").unwrap().as_path().display().to_string();
     let event_crates = parse_ts_event_files(vec![crate_path]);
     let event_crates = parse_ts_event_files(vec![crate_path]);