Skip to content

Commit

Permalink
create fresh mergeinventory only if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Aelto committed Dec 2, 2022
1 parent 112cad0 commit 9bf5f3b
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/models/modlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,17 @@ impl ModList {
fs::create_dir_all(self.bundles_path());
fs::create_dir_all(self.mergedbundles_path());

let mergeinventory_content = "
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<MergeInventory xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
</MergeInventory>
".trim();

fs::write(self.mergeinventory_path(), &mergeinventory_content);
let mergeinventory_path = self.mergeinventory_path();
if !mergeinventory_path.exists() {
let mergeinventory_content = "
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<MergeInventory xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
</MergeInventory>
".trim();

fs::write(mergeinventory_path, &mergeinventory_content);
}
}

pub fn packed_folder_name(&self) -> String {
Expand Down

1 comment on commit 9bf5f3b

@PhilHertzke
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the update, seems to work! I never would have found that only few lines down lol phew I just assumed making a symlink automatically did it and I was intentionally searching (with my eyes cause I thought it'd be easy to see) for <?xml version= etc lol after looking in every file twice I started to give up cause I searched for a function name with notepad++ all the source files and couldn't even find that so I was massively dejected. But, fortunately you've fixed it! and shown it wasn't too bad so I'm not too terrified to still learn to program thanks!

Please sign in to comment.