mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-04-24 14:47:13 -04:00
chore: fix unit errors
This commit is contained in:
parent
a7819c6456
commit
e1f9260982
1 changed files with 12 additions and 2 deletions
|
@ -9,6 +9,16 @@ use syn::Item;
|
||||||
use walkdir::WalkDir;
|
use walkdir::WalkDir;
|
||||||
|
|
||||||
pub fn gen(crate_name: &str) {
|
pub fn gen(crate_name: &str) {
|
||||||
|
if std::env::var("CARGO_MAKE_WORKING_DIRECTORY").is_err() {
|
||||||
|
log::warn!("CARGO_MAKE_WORKING_DIRECTORY was not set, skip generate dart pb");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if std::env::var("FLUTTER_FLOWY_SDK_PATH").is_err() {
|
||||||
|
log::warn!("FLUTTER_FLOWY_SDK_PATH was not set, skip generate dart pb");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
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_dart_event_files(vec![crate_path]);
|
let event_crates = parse_dart_event_files(vec![crate_path]);
|
||||||
let event_ast = event_crates.iter().map(parse_event_crate).flatten().collect::<Vec<_>>();
|
let event_ast = event_crates.iter().map(parse_event_crate).flatten().collect::<Vec<_>>();
|
||||||
|
@ -25,8 +35,8 @@ pub fn gen(crate_name: &str) {
|
||||||
|
|
||||||
let dart_event_folder = format!(
|
let dart_event_folder = format!(
|
||||||
"{}/{}/lib/dispatch/dart_event/{}",
|
"{}/{}/lib/dispatch/dart_event/{}",
|
||||||
env!("CARGO_MAKE_WORKING_DIRECTORY"),
|
std::env::var("CARGO_MAKE_WORKING_DIRECTORY").unwrap(),
|
||||||
env!("FLUTTER_FLOWY_SDK_PATH"),
|
std::env::var("FLUTTER_FLOWY_SDK_PATH").unwrap(),
|
||||||
crate_name
|
crate_name
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue