Skip to content

Commit

Permalink
creating the esp_ide.json file added
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Gadorek committed Oct 1, 2024
1 parent 9e9707e commit a339ea2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
6 changes: 5 additions & 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", branch="esp_idf_json" }
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
1 change: 1 addition & 0 deletions src/wizard/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use dialoguer::{theme::ColorfulTheme, Confirm, Input, MultiSelect, Select};
use indicatif::{ProgressBar, ProgressState, ProgressStyle};
use log::debug;
use rust_i18n::t;
use std::path::PathBuf;
use std::sync::mpsc;
use std::thread;
use std::{
Expand Down
23 changes: 22 additions & 1 deletion src/wizard/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use dialoguer::FolderSelect;
use idf_im_lib::idf_tools::ToolsFile;
use idf_im_lib::settings::Settings;
use idf_im_lib::ProgressMessage;
use idf_im_lib::{ensure_path, ProgressMessage};
use indicatif::{ProgressBar, ProgressState, ProgressStyle};
use log::{debug, error, info, trace, warn};
use rust_i18n::t;
Expand Down Expand Up @@ -742,6 +742,27 @@ pub async fn run_wizzard_run(mut config: Settings) -> Result<(), String> {
)
}
save_config_if_desired(&config)?;
let ide_conf_path_tmp = PathBuf::from(
&config.esp_idf_json_path.clone().unwrap_or(
dirs::home_dir()
.unwrap()
.join(".esp_installation_manager")
.to_str()
.unwrap()
.to_string(),
),
);
match ensure_path(ide_conf_path_tmp.to_str().unwrap()) {
Ok(_) => (),
Err(err) => {
error!("Failed to create IDE configuration directory: {}", err);
return Err(err.to_string());
}
}
let ide_conf_path = ide_conf_path_tmp.join("esp_ide.json");
println!("^^^^^^^^^ {}", &ide_conf_path.to_str().unwrap());
config.save_esp_ide_json(ide_conf_path.to_str().unwrap())?;

match std::env::consts::OS {
"windows" => {
println!("{}", t!("wizard.windows.finish_steps.line_1"));
Expand Down

0 comments on commit a339ea2

Please sign in to comment.