Skip to content

Commit

Permalink
Merge pull request #2340 from AlexV525/fix/dart-command-path
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy authored Oct 8, 2024
2 parents a313aec + e813147 commit 02916db
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl InternalConfig {
add_mod_to_lib: config.add_mod_to_lib.unwrap_or(true),
build_runner: config.build_runner.unwrap_or(true),
web_enabled,
dart_output: dart_output_dir,
dart_root,
rust_crate_dir,
rust_output_path,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub(crate) struct PolisherInternalConfig {
pub add_mod_to_lib: bool,
pub build_runner: bool,
pub web_enabled: bool,
pub dart_output: PathBuf,
pub dart_root: PathBuf,
pub rust_crate_dir: PathBuf,
pub rust_output_path: PathBuf,
Expand Down
2 changes: 1 addition & 1 deletion frb_codegen/src/library/codegen/polisher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn execute_dart_fix(
progress_bar_pack: &GeneratorProgressBarPack,
) -> anyhow::Result<()> {
let _pb = progress_bar_pack.polish_dart_fix.start();
dart_fix(&config.dart_root)
dart_fix(&config.dart_output)
}

fn execute_dart_format(
Expand Down
3 changes: 2 additions & 1 deletion frb_codegen/src/library/commands/dart_fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ use std::path::Path;

#[allow(clippy::vec_init_then_push)]
pub fn dart_fix(base_path: &Path) -> Result<()> {
debug!("execute dart_fix");
debug!("execute dart_fix base_path={base_path:?}");

let res = command_run!(
call_shell[Some(base_path), None],
"dart",
"fix",
"--apply",
"."
)?;
check_exit_code(&res)?;
Ok(())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"build_runner": true,
"c_output_path": "{the-working-directory}/frb_generated.h",
"dart_format_line_length": 80,
"dart_output": "{the-working-directory}/my_dart_folder",
"dart_root": "{the-working-directory}",
"duplicated_c_output_path": [],
"enable_auto_upgrade": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"build_runner": true,
"c_output_path": "{the-working-directory}/frb_generated.h",
"dart_format_line_length": 80,
"dart_output": "{the-working-directory}/my_dart_folder",
"dart_root": "{the-working-directory}",
"duplicated_c_output_path": [],
"enable_auto_upgrade": true,
Expand Down

0 comments on commit 02916db

Please sign in to comment.