Skip to content

Commit

Permalink
fix: avoid setting extension when writing source tree to disk (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Feb 21, 2024
1 parent 5bc93e7 commit 6864420
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 6864420

Please sign in to comment.