Skip to content

Commit

Permalink
fix: avoid setting extension when writing source tree to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Feb 20, 2024
1 parent aae3b16 commit cbedb9a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/source_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ impl SourceTree {
for entry in &self.entries {
let mut sanitized_path = sanitize_path(&entry.path);
if sanitized_path.extension().is_none() {
sanitized_path.set_extension("sol");
let with_extension = sanitized_path.with_extension("sol");
if !self.entries.iter().any(|e| e.path == with_extension) {
sanitized_path = with_extension;
}
}
let joined = dir.join(sanitized_path);
if let Some(parent) = joined.parent() {
Expand Down

0 comments on commit cbedb9a

Please sign in to comment.