Skip to content

Commit

Permalink
feat: Add back deploy-missing-libraries flag (#357)
Browse files Browse the repository at this point in the history
Co-authored-by: Nisheeth Barthwal <[email protected]>
Co-authored-by: Francesco Dainese <[email protected]>
  • Loading branch information
3 people authored May 7, 2024
1 parent 30ad9f8 commit a7196c2
Show file tree
Hide file tree
Showing 5 changed files with 631 additions and 204 deletions.
17 changes: 17 additions & 0 deletions crates/config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,23 @@ impl Config {
self.__root.0.join(Config::FILE_NAME)
}

/// Sets the non-inlinable libraries inside a `foundry.toml` file but only if it exists the
/// 'libraries' entry
///
/// # Errors
///
/// An error if the `foundry.toml` could not be parsed.
pub fn update_libraries(&self) -> eyre::Result<()> {
self.update(|doc| {
let profile = self.profile.as_str().as_str();
let libraries: toml_edit::Value =
self.libraries.iter().map(toml_edit::Value::from).collect();
let libraries = toml_edit::value(libraries);
doc[Config::PROFILE_SECTION][profile]["libraries"] = libraries;
true
})
}

/// Returns the selected profile
///
/// If the `FOUNDRY_PROFILE` env variable is not set, this returns the `DEFAULT_PROFILE`
Expand Down
Loading

0 comments on commit a7196c2

Please sign in to comment.