Skip to content

Commit

Permalink
added proper whitespace quotation to the python env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Gadorek committed Sep 6, 2024
1 parent 1597cae commit 1a0b2cf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 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.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
tokio = {version = "1.37.0", features=["full"]}
idf-im-lib = { git = "https://github.com/espressif/idf-im-lib.git", branch="master" }
idf-im-lib = { git = "https://github.com/espressif/idf-im-lib.git", rev="62f6dec50813069f304bf4873d1a7b980935e023" }
clap = {version = "4.5", features = ["cargo", "derive", "color"]}
crossterm = "0.27.0"
dialoguer = { git = "https://github.com/Hahihula/dialoguer.git", branch = "folder-select", features = ["folder-select"] }
Expand Down
29 changes: 23 additions & 6 deletions src/wizard/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,20 +395,37 @@ fn setup_environment_variables(
let mut env_vars = vec![];

// env::set_var("IDF_TOOLS_PATH", tool_install_directory);
let instal_dir_string = tool_install_directory.to_str().unwrap().to_string();
env_vars.push((
"IDF_TOOLS_PATH".to_string(),
tool_install_directory.to_str().unwrap().to_string(),
if instal_dir_string.contains(" ") {
format!("\"{}\"", instal_dir_string)
} else {
instal_dir_string
},
));
let idf_path_string = idf_path.to_str().unwrap().to_string();
env_vars.push((
"IDF_PATH".to_string(),
idf_path.to_str().unwrap().to_string(),
if idf_path_string.contains(" ") {
format!("\"{}\"", idf_path_string)
} else {
idf_path_string
},
));

let python_env_path = tool_install_directory.join("python");
// env::set_var("IDF_PYTHON_ENV_PATH", &python_env_path);
let python_env_path_string = tool_install_directory
.join("python")
.to_str()
.unwrap()
.to_string();
env_vars.push((
"IDF_PYTHON_ENV_PATH".to_string(),
python_env_path.to_str().unwrap().to_string(),
if python_env_path_string.contains(" ") {
format!("\"{}\"", python_env_path_string)
} else {
python_env_path_string
},
));

Ok(env_vars)
Expand Down Expand Up @@ -695,7 +712,7 @@ pub async fn run_wizzard_run(mut config: Settings) -> Result<(), String> {
println!("{}:", t!("wizard.posix.finish_steps.line_4"));
for idf_version in config.idf_versions.clone().unwrap() {
println!(
" {} {}/{}",
" {} \"{}/{}\"",
t!("wizard.posix.finish_steps.line_5"),
config.path.clone().unwrap().to_str().unwrap(),
format!("activate_idf_{}.sh", idf_version),
Expand Down

0 comments on commit 1a0b2cf

Please sign in to comment.