Skip to content

Commit 2282087

Browse files
authored
Pass-through --target-dir to cargo (esp-rs#187)
1 parent 55bce33 commit 2282087

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cargo-espflash/src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ pub struct BuildOpts {
8686
/// Target to build for
8787
#[clap(long)]
8888
pub target: Option<String>,
89+
/// Directory for all generated artifacts
90+
#[clap(long)]
91+
pub target_dir: Option<String>,
8992
/// Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
9093
#[clap(short = 'Z')]
9194
pub unstable: Option<Vec<String>>,
@@ -232,6 +235,11 @@ fn build(
232235
// argument or in the cargo config file.
233236
let mut args = vec!["--target".to_string(), target.to_string()];
234237

238+
if let Some(target_dir) = &build_options.target_dir {
239+
args.push("--target-dir".to_string());
240+
args.push(target_dir.to_string());
241+
}
242+
235243
if build_options.release {
236244
args.push("--release".to_string());
237245
}

0 commit comments

Comments
 (0)