Skip to content

Commit

Permalink
Ignore existing qmod dependencies in template
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernthedev committed Aug 12, 2023
1 parent 421ed54 commit 3aae578
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/commands/qmod/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ use std::path::PathBuf;

use clap::{Args, Subcommand};
use color_eyre::{eyre::ensure, Result};
use qpm_package::models::{dependency::SharedPackageConfig};
use itertools::Itertools;
use qpm_package::models::dependency::SharedPackageConfig;
use qpm_qmod::models::mod_json::ModJson;
use semver::Version;

use crate::{
models::{
mod_json::{ModJsonExtensions, PreProcessingData},
package::{PackageConfigExtensions},
},
use crate::models::{
mod_json::{ModJsonExtensions, PreProcessingData},
package::PackageConfigExtensions,
};

use super::Command;
Expand Down Expand Up @@ -167,9 +166,20 @@ fn execute_qmod_build_operation(build_parameters: BuildQmodOperationArgs) -> Res
.append(&mut template_mod_json.mod_files);
}

existing_json
.dependencies
.append(&mut template_mod_json.dependencies);
// TODO: REDO
existing_json.dependencies.append(
&mut template_mod_json
.dependencies
.clone()
.into_iter()
.filter(|d| {
!existing_json
.dependencies
.iter()
.any(|existing_d| existing_d.id == d.id)
})
.collect_vec(),
);
existing_json
.library_files
.append(&mut template_mod_json.library_files);
Expand Down

0 comments on commit 3aae578

Please sign in to comment.