Skip to content

Commit

Permalink
skip downloading client side mods
Browse files Browse the repository at this point in the history
  • Loading branch information
dxbednarczyk committed Feb 28, 2024
1 parent 7ed6d2f commit 976e3be
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/project/actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ pub fn fetch(
.into_json()?;

if project_info.server_side == "unsupported" {
warn!("project {id} does not support server side");
warn!("project {id} does not support server side, skipping");
return Err(anyhow!("client side"))
}

if !project_info.loaders.contains(&lockfile.loader.name) {
Expand Down Expand Up @@ -132,8 +133,21 @@ pub fn add(
return Ok(());
}

let (mut version_info, project_info, file, save_to) =
fetch(lockfile, id, version_input.cloned())?;
let (mut version_info, project_info, file, save_to) = {
let fetched = fetch(lockfile, id, version_input.cloned());

if fetched.is_ok() {
fetched.unwrap()
} else {
let error = fetched.err().unwrap();

if &error.to_string() == "client_side" {
return Ok(())
} else {
return Err(error)
}
}
};

if no_deps {
version_info.dependencies.clear();
Expand Down

0 comments on commit 976e3be

Please sign in to comment.