Skip to content

Commit 1ecaeb2

Browse files
committed
fix(cli): inject config feature flags when features arg is not provided
1 parent 7e3d672 commit 1ecaeb2

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

.changes/fix-config-features.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"cli.rs": patch
3+
"cli.js": patch
4+
---
5+
6+
Fixes injection of Cargo features defined in the configuration file.

tooling/cli/src/build.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,10 @@ pub fn command(mut options: Options) -> Result<()> {
157157
options.runner = config_.build.runner.clone();
158158
}
159159

160-
if let Some(list) = options.features.as_mut() {
161-
list.extend(config_.build.features.clone().unwrap_or_default());
162-
}
160+
options
161+
.features
162+
.get_or_insert(Vec::new())
163+
.extend(config_.build.features.clone().unwrap_or_default());
163164

164165
let bin_path = app_settings.app_binary_path(&interface_options)?;
165166
let out_dir = bin_path.parent().unwrap();

0 commit comments

Comments
 (0)