chore: refactor tauri gen files path

This commit is contained in:
nathan 2023-01-22 17:08:56 +08:00
parent 0100305af0
commit d2db49efab
2 changed files with 2 additions and 4 deletions

View File

@ -101,8 +101,7 @@ fn generate_ts_protobuf_files(
protoc_bin_path: &Path,
) {
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();
output.push(root);

View File

@ -14,8 +14,7 @@ use walkdir::WalkDir;
pub fn gen(crate_name: &str) {
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 event_crates = parse_ts_event_files(vec![crate_path]);