File tree Expand file tree Collapse file tree 2 files changed +22
-13
lines changed
Expand file tree Collapse file tree 2 files changed +22
-13
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " cargo-packager " : patch
3+ " @crabnebula/packager " : patch
4+ ---
5+
6+ Fixed a bug where "binaries" parameter in Cargo.toml would be ignored and all targets would be packaged.
Original file line number Diff line number Diff line change @@ -200,19 +200,22 @@ fn load_configs_from_cargo_workspace(cli: &super::Cli) -> Result<Vec<(Option<Pat
200200 . as_ref ( )
201201 . map ( |p| p. as_std_path ( ) . to_owned ( ) ) ;
202202 }
203- let targets = package
204- . targets
205- . iter ( )
206- . filter ( |t| t. is_bin ( ) )
207- . collect :: < Vec < _ > > ( ) ;
208- for target in & targets {
209- config. binaries . push ( Binary {
210- path : target. name . clone ( ) . into ( ) ,
211- main : match targets. len ( ) {
212- 1 => true ,
213- _ => target. name == package. name ,
214- } ,
215- } )
203+ // Auto-detect binaries if none were explicitly configured
204+ if config. binaries . is_empty ( ) {
205+ let targets = package
206+ . targets
207+ . iter ( )
208+ . filter ( |t| t. is_bin ( ) )
209+ . collect :: < Vec < _ > > ( ) ;
210+ for target in & targets {
211+ config. binaries . push ( Binary {
212+ path : target. name . clone ( ) . into ( ) ,
213+ main : match targets. len ( ) {
214+ 1 => true ,
215+ _ => target. name == package. name ,
216+ } ,
217+ } )
218+ }
216219 }
217220 configs. push ( (
218221 Some ( package. manifest_path . as_std_path ( ) . to_path_buf ( ) ) ,
You can’t perform that action at this time.
0 commit comments