cli: add --deps flag to import command
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I19ac6af4c80fe7e86fe8259ed3bf49166a6a6964
This commit is contained in:
parent
6648de9971
commit
63f09b359d
1 changed files with 27 additions and 21 deletions
|
|
@ -13,6 +13,10 @@ pub async fn execute(
|
|||
config_path: &Path,
|
||||
) -> Result<()> {
|
||||
log::info!("Importing modpack from {}", args.file);
|
||||
log::info!(
|
||||
"Dependency resolution: {}",
|
||||
if args.deps { "enabled" } else { "disabled" }
|
||||
);
|
||||
|
||||
let path = Path::new(&args.file);
|
||||
|
||||
|
|
@ -159,24 +163,25 @@ async fn import_modrinth(
|
|||
|
||||
// Create config
|
||||
let config = Config {
|
||||
name: index["name"]
|
||||
name: index["name"]
|
||||
.as_str()
|
||||
.unwrap_or("Imported Pack")
|
||||
.to_string(),
|
||||
version: index["versionId"]
|
||||
version: index["versionId"]
|
||||
.as_str()
|
||||
.unwrap_or("1.0.0")
|
||||
.to_string(),
|
||||
description: index["summary"]
|
||||
description: index["summary"]
|
||||
.as_str()
|
||||
.map(std::string::ToString::to_string),
|
||||
author: None,
|
||||
overrides: vec!["overrides".to_string()],
|
||||
server_overrides: None,
|
||||
client_overrides: None,
|
||||
paths: Default::default(),
|
||||
projects: None,
|
||||
export_profiles: None,
|
||||
author: None,
|
||||
overrides: vec!["overrides".to_string()],
|
||||
server_overrides: None,
|
||||
client_overrides: None,
|
||||
paths: Default::default(),
|
||||
projects: None,
|
||||
export_profiles: None,
|
||||
export_server_side_projects_to_client: None,
|
||||
};
|
||||
|
||||
// Save files using provided paths
|
||||
|
|
@ -341,24 +346,25 @@ async fn import_curseforge(
|
|||
|
||||
// Create config
|
||||
let config = Config {
|
||||
name: manifest["name"]
|
||||
name: manifest["name"]
|
||||
.as_str()
|
||||
.unwrap_or("Imported Pack")
|
||||
.to_string(),
|
||||
version: manifest["version"]
|
||||
version: manifest["version"]
|
||||
.as_str()
|
||||
.unwrap_or("1.0.0")
|
||||
.to_string(),
|
||||
description: None,
|
||||
author: manifest["author"]
|
||||
description: None,
|
||||
author: manifest["author"]
|
||||
.as_str()
|
||||
.map(std::string::ToString::to_string),
|
||||
overrides: vec!["overrides".to_string()],
|
||||
server_overrides: None,
|
||||
client_overrides: None,
|
||||
paths: Default::default(),
|
||||
projects: None,
|
||||
export_profiles: None,
|
||||
.map(|s| s.to_string()),
|
||||
overrides: vec!["overrides".to_string()],
|
||||
server_overrides: None,
|
||||
client_overrides: None,
|
||||
paths: Default::default(),
|
||||
projects: None,
|
||||
export_profiles: None,
|
||||
export_server_side_projects_to_client: None,
|
||||
};
|
||||
|
||||
// Save files using provided paths
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue