Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
fix: set metadata file extension properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Feb 16, 2022
1 parent c090a98 commit a03127f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ethers-solc/src/artifact_output/configurable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ impl ConfigurableArtifacts {
if self.additional_values.ir {
selection.push(ContractOutputSelection::Ir);
}
if self.additional_values.ir_optimized {
if self.additional_values.ir_optimized || self.additional_files.ir_optimized {
selection.push(ContractOutputSelection::IrOptimized);
}
if self.additional_values.metadata {
if self.additional_values.metadata || self.additional_files.metadata {
selection.push(ContractOutputSelection::Metadata);
}
if self.additional_values.storage_layout {
Expand All @@ -163,10 +163,10 @@ impl ConfigurableArtifacts {
if self.additional_values.gas_estimates {
selection.push(EvmOutputSelection::GasEstimates.into());
}
if self.additional_values.assembly {
if self.additional_values.assembly || self.additional_files.assembly {
selection.push(EvmOutputSelection::Assembly.into());
}
if self.additional_values.ewasm {
if self.additional_values.ewasm || self.additional_files.ewasm {
selection.push(EwasmOutputSelection::All.into());
}
selection
Expand Down Expand Up @@ -444,7 +444,7 @@ impl ExtraOutputFiles {
pub fn write_extras(&self, contract: &Contract, file: &Path) -> Result<(), SolcError> {
if self.metadata {
if let Some(ref metadata) = contract.metadata {
let file = file.join(".metadata.json");
let file = file.with_extension("metadata.json");
fs::write(&file, serde_json::to_string_pretty(metadata)?)
.map_err(|err| SolcError::io(err, file))?
}
Expand Down

0 comments on commit a03127f

Please sign in to comment.