Skip to content

Commit 0ffcbbe

Browse files
committed
Revert "Delete dart output dir before regenerate it"
Deleting dart output in `build.rs` was causing issues when compiling flutter binaries This reverts commit 70db2d9
1 parent deb74a9 commit 0ffcbbe

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

rust/build.rs

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// Copyright (c) 2023-2024 Rust Nostr Developers
33
// Distributed under the MIT software license
44

5-
use std::fs;
6-
use std::path::PathBuf;
75
use std::process::{Command, Stdio};
86

97
use lib_flutter_rust_bridge_codegen::codegen;
@@ -20,24 +18,14 @@ fn main() {
2018
panic!("Warning: flutter not installed.");
2119
}
2220

23-
// Parse config
24-
let config = Config::from_config_file("../flutter_rust_bridge.yaml")
25-
.unwrap()
26-
.unwrap();
27-
28-
// Delete previously generated dart code
29-
if let Some(path) = &config.dart_output {
30-
let dir: PathBuf = PathBuf::from("..").join(path);
31-
if dir.exists() {
32-
println!("Deleting {}", dir.display());
33-
fs::remove_dir_all(&dir).unwrap();
34-
}
35-
36-
fs::create_dir_all(dir).unwrap();
37-
}
38-
3921
// Execute code generator with auto-detected config
40-
codegen::generate(config, Default::default()).unwrap();
22+
codegen::generate(
23+
Config::from_config_file("../flutter_rust_bridge.yaml")
24+
.unwrap()
25+
.unwrap(),
26+
Default::default(),
27+
)
28+
.unwrap();
4129
}
4230

4331
fn is_dart_installed() -> bool {

0 commit comments

Comments
 (0)