File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -280,16 +280,18 @@ To see all the flags the proxied tool accepts run `cargo-{} -- --help`.{}",
280
280
281
281
pub fn run ( tool : Tool , matches : ArgMatches ) -> Result < i32 > {
282
282
let mut metadata_command = MetadataCommand :: new ( ) ;
283
- if let Some ( features) = matches. get_many :: < String > ( "features" ) {
284
- metadata_command. features ( CargoOpt :: SomeFeatures (
285
- features. map ( |s| s. to_owned ( ) ) . collect ( ) ,
286
- ) ) ;
287
- }
288
- if matches. get_flag ( "no-default-features" ) {
289
- metadata_command. features ( CargoOpt :: NoDefaultFeatures ) ;
290
- }
291
- if matches. get_flag ( "all-features" ) {
292
- metadata_command. features ( CargoOpt :: AllFeatures ) ;
283
+ if tool. needs_build ( ) {
284
+ if let Some ( features) = matches. get_many :: < String > ( "features" ) {
285
+ metadata_command. features ( CargoOpt :: SomeFeatures (
286
+ features. map ( |s| s. to_owned ( ) ) . collect ( ) ,
287
+ ) ) ;
288
+ }
289
+ if matches. get_flag ( "no-default-features" ) {
290
+ metadata_command. features ( CargoOpt :: NoDefaultFeatures ) ;
291
+ }
292
+ if matches. get_flag ( "all-features" ) {
293
+ metadata_command. features ( CargoOpt :: AllFeatures ) ;
294
+ }
293
295
}
294
296
if let Some ( path) = matches. get_one :: < String > ( "manifest-path" ) {
295
297
metadata_command. manifest_path ( path) ;
You can’t perform that action at this time.
0 commit comments