Skip to content

Commit

Permalink
miniscule changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Marlstar committed Aug 26, 2024
1 parent e062da1 commit 3efbecf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion backend/src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ pub async fn download(url: &str, write_path: &str, mod_name: &str, mod_version:

println!(" -> Moving dll to mods folder");

tokio::fs::create_dir_all(write_path).await?;
let final_path = format!(
"{}\\{}-{}.{}.{}.{}.dll",
crate::ScarabDir::MOD.dir(),
write_path,
mod_name,
mod_version[0], mod_version[1], mod_version[2], mod_version[3],
);
Expand Down
5 changes: 3 additions & 2 deletions backend/src/mod_manager.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::fmt::format;

use crate::ModDatabase;
use crate::ScarabDir;
use crate::ModVersion;
Expand Down Expand Up @@ -51,7 +53,7 @@ impl ModManager {
pub fn mod_installed(mod_name: &String) -> Option<ModVersion> {
let mod_base_dir = ScarabDir::MOD.dir();
let mod_dir = format!("{mod_base_dir}/{mod_name}");

if !std::path::Path::new(&mod_dir).exists() {
return None;
}
Expand All @@ -61,7 +63,6 @@ impl ModManager {
if !file.is_file() { continue };
if file.extension() != Some(std::ffi::OsStr::new("dll")) { continue };


let name = file.file_stem().unwrap();
let version_vec: Vec<usize> = name.to_str().unwrap() // File name not including extension
.split('-').nth_back(0).unwrap() // Raw version string
Expand Down
2 changes: 2 additions & 0 deletions backend/src/util/mod.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
mod mod_version;
pub use mod_version::ModVersion;
pub use mod_version::newer_version_than;
pub use mod_version::older_version_than;

0 comments on commit 3efbecf

Please sign in to comment.