Skip to content

Commit

Permalink
EIM-18 added possibility to install additional idf_tools features
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Gadorek committed Jan 31, 2025
1 parent 86dc1cd commit 21ac5e3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions src/cli_args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ pub struct Cli {
help = "if set, the installer will as it's very last move save the configuration to the specified file path. This file can than be used to repeat the installation with the same settings."
)]
pub config_file_save_path: Option<String>,

#[arg(
long,
help = "Comma separated list of additional IDF features (ci, docs, pytests, etc.) to be installed with ESP-IDF."
)]
pub idf_features: Option<String>,
}

impl IntoIterator for Cli {
Expand Down Expand Up @@ -199,6 +205,11 @@ impl IntoIterator for Cli {
"config_file_save_path".to_string(),
self.config_file_save_path.map(Into::into),
),
(
"idf_features".to_string(),
self.idf_features
.map(|s| s.split(',').collect::<Vec<&str>>().into()),
),
]
.into_iter()
}
Expand Down
14 changes: 13 additions & 1 deletion src/wizard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,19 @@ pub async fn run_wizzard_run(mut config: Settings) -> Result<(), String> {

let idf_tools_path = get_and_validate_idf_tools_path(&mut config, &idf_path)?;

idf_im_lib::python_utils::run_idf_tools_py(idf_tools_path.to_str().unwrap(), &env_vars)?;
if config.idf_features.is_some() {
let features = config.idf_features.clone().unwrap();
idf_im_lib::python_utils::run_idf_tools_py_with_features(
idf_tools_path.to_str().unwrap(),
&env_vars,
&features,
)?;
} else {
idf_im_lib::python_utils::run_idf_tools_py(
idf_tools_path.to_str().unwrap(),
&env_vars,
)?;
}

let export_paths = idf_im_lib::idf_tools::get_tools_export_paths(
tools,
Expand Down

0 comments on commit 21ac5e3

Please sign in to comment.