Skip to content

Commit

Permalink
renamed the config from esp_idf.json to eim_idf.json
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Gadorek authored and Hahihula committed Dec 5, 2024
1 parent b37120c commit fdf80dd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/idf_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl IdfConfig {
///
/// ```rust
/// let config = IdfConfig { ... };
/// config.to_file("esp_ide.json", true)?;
/// config.to_file("eim_idf.json", true)?;
/// ```
pub fn to_file<P: AsRef<Path>>(&mut self, path: P, pretty: bool) -> Result<()> {
// Create parent directories if they don't exist
Expand All @@ -70,7 +70,7 @@ impl IdfConfig {
.open(path)?;

file.write_all(json_string.as_bytes())
.with_context(|| anyhow!("writing to file esp_ide.json failed"))
.with_context(|| anyhow!("writing to file eim_idf.json failed"))
}

/// Reads and parses an IDF configuration from a file.
Expand Down
2 changes: 1 addition & 1 deletion src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl Settings {

let tmp_path = PathBuf::from(self.esp_idf_json_path.clone().unwrap_or_default());

let ide_conf_path = tmp_path.join("esp_ide.json");
let ide_conf_path = tmp_path.join("eim_idf.json");
config.to_file(ide_conf_path, true)
}
}
4 changes: 2 additions & 2 deletions src/version_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ use crate::{
/// Returns the default path to the ESP-IDF configuration file.
///
/// The default path is constructed by joining the `esp_idf_json_path` setting from the `Settings` struct
/// with the filename "esp_ide.json". If `esp_idf_json_path` is not set, the default path will be
/// with the filename "eim_idf.json". If `esp_idf_json_path` is not set, the default path will be
/// constructed using the default settings.
///
/// # Returns
///
/// A `PathBuf` representing the default path to the ESP-IDF configuration file.
fn get_default_config_path() -> PathBuf {
let default_settings = Settings::default();
PathBuf::from(default_settings.esp_idf_json_path.unwrap_or_default()).join("esp_ide.json")
PathBuf::from(default_settings.esp_idf_json_path.unwrap_or_default()).join("eim_idf.json")
}

// todo: add optional path parameter enabling the user to specify a custom config file
Expand Down

0 comments on commit fdf80dd

Please sign in to comment.