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,
|
config_path: &Path,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
log::info!("Importing modpack from {}", args.file);
|
log::info!("Importing modpack from {}", args.file);
|
||||||
|
log::info!(
|
||||||
|
"Dependency resolution: {}",
|
||||||
|
if args.deps { "enabled" } else { "disabled" }
|
||||||
|
);
|
||||||
|
|
||||||
let path = Path::new(&args.file);
|
let path = Path::new(&args.file);
|
||||||
|
|
||||||
|
|
@ -159,24 +163,25 @@ async fn import_modrinth(
|
||||||
|
|
||||||
// Create config
|
// Create config
|
||||||
let config = Config {
|
let config = Config {
|
||||||
name: index["name"]
|
name: index["name"]
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap_or("Imported Pack")
|
.unwrap_or("Imported Pack")
|
||||||
.to_string(),
|
.to_string(),
|
||||||
version: index["versionId"]
|
version: index["versionId"]
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap_or("1.0.0")
|
.unwrap_or("1.0.0")
|
||||||
.to_string(),
|
.to_string(),
|
||||||
description: index["summary"]
|
description: index["summary"]
|
||||||
.as_str()
|
.as_str()
|
||||||
.map(std::string::ToString::to_string),
|
.map(std::string::ToString::to_string),
|
||||||
author: None,
|
author: None,
|
||||||
overrides: vec!["overrides".to_string()],
|
overrides: vec!["overrides".to_string()],
|
||||||
server_overrides: None,
|
server_overrides: None,
|
||||||
client_overrides: None,
|
client_overrides: None,
|
||||||
paths: Default::default(),
|
paths: Default::default(),
|
||||||
projects: None,
|
projects: None,
|
||||||
export_profiles: None,
|
export_profiles: None,
|
||||||
|
export_server_side_projects_to_client: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Save files using provided paths
|
// Save files using provided paths
|
||||||
|
|
@ -341,24 +346,25 @@ async fn import_curseforge(
|
||||||
|
|
||||||
// Create config
|
// Create config
|
||||||
let config = Config {
|
let config = Config {
|
||||||
name: manifest["name"]
|
name: manifest["name"]
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap_or("Imported Pack")
|
.unwrap_or("Imported Pack")
|
||||||
.to_string(),
|
.to_string(),
|
||||||
version: manifest["version"]
|
version: manifest["version"]
|
||||||
.as_str()
|
.as_str()
|
||||||
.unwrap_or("1.0.0")
|
.unwrap_or("1.0.0")
|
||||||
.to_string(),
|
.to_string(),
|
||||||
description: None,
|
description: None,
|
||||||
author: manifest["author"]
|
author: manifest["author"]
|
||||||
.as_str()
|
.as_str()
|
||||||
.map(std::string::ToString::to_string),
|
.map(|s| s.to_string()),
|
||||||
overrides: vec!["overrides".to_string()],
|
overrides: vec!["overrides".to_string()],
|
||||||
server_overrides: None,
|
server_overrides: None,
|
||||||
client_overrides: None,
|
client_overrides: None,
|
||||||
paths: Default::default(),
|
paths: Default::default(),
|
||||||
projects: None,
|
projects: None,
|
||||||
export_profiles: None,
|
export_profiles: None,
|
||||||
|
export_server_side_projects_to_client: None,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Save files using provided paths
|
// Save files using provided paths
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue