Skip to content

Commit

Permalink
Merge pull request #322 from Desdaemon/patch-1
Browse files Browse the repository at this point in the history
Quote arguments when calling external commands
  • Loading branch information
fzyzcjy authored Feb 10, 2022
2 parents c3ecc83 + 789d949 commit 3cb8833
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions frb_codegen/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ include = [{}]

execute_command(
&format!(
"cbindgen -v --config {} --output {}",
"cbindgen -v --config \"{}\" --output \"{}\"",
config_file.path().to_str().unwrap(),
c_output_path,
),
Expand Down Expand Up @@ -185,7 +185,7 @@ fn ffigen(
// NOTE please install ffigen globally first: `dart pub global activate ffigen`
execute_command(
&format!(
"dart pub global run ffigen --config {}",
"dart pub global run ffigen --config \"{}\"",
config_file.path().to_str().unwrap()
),
None,
Expand All @@ -194,7 +194,7 @@ fn ffigen(

pub fn format_rust(path: &str) {
debug!("execute format_rust path={}", path);
execute_command(&format!("rustfmt {}", path), None);
execute_command(&format!("rustfmt \"{}\"", path), None);
}

pub fn format_dart(path: &str, line_length: i32) {
Expand All @@ -204,7 +204,7 @@ pub fn format_dart(path: &str, line_length: i32) {
);
execute_command(
&format!(
"dart format {} --line-length {}",
"dart format \"{}\" --line-length {}",
path,
&line_length.to_string(),
),
Expand Down

0 comments on commit 3cb8833

Please sign in to comment.