cli: use multiplatform client for project adds
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I8059a38fab1a587e4564998f332ce7766a6a6964
This commit is contained in:
parent
019a1b7752
commit
e1720778ab
2 changed files with 9 additions and 16 deletions
|
|
@ -13,18 +13,13 @@ fn get_loaders(lockfile: &LockFile) -> Vec<String> {
|
||||||
|
|
||||||
pub fn create_all_platforms()
|
pub fn create_all_platforms()
|
||||||
-> HashMap<String, Box<dyn crate::platform::PlatformClient>> {
|
-> HashMap<String, Box<dyn crate::platform::PlatformClient>> {
|
||||||
const MODRINTH: &str = "modrinth";
|
|
||||||
const CURSEFORGE: &str = "curseforge";
|
|
||||||
|
|
||||||
let mut platforms = HashMap::new();
|
let mut platforms = HashMap::new();
|
||||||
|
|
||||||
if let Ok(platform) = create_platform(MODRINTH, None) {
|
let curseforge_key = std::env::var("CURSEFORGE_API_KEY").ok();
|
||||||
platforms.insert(MODRINTH.to_owned(), platform);
|
if let Ok(platform) = create_platform("multiplatform", curseforge_key) {
|
||||||
}
|
platforms.insert("multiplatform".to_owned(), platform);
|
||||||
if let Ok(platform) =
|
} else if let Ok(platform) = create_platform("modrinth", None) {
|
||||||
create_platform(CURSEFORGE, std::env::var("CURSEFORGE_API_KEY").ok())
|
platforms.insert("modrinth".to_owned(), platform);
|
||||||
{
|
|
||||||
platforms.insert(CURSEFORGE.to_owned(), platform);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
platforms
|
platforms
|
||||||
|
|
|
||||||
|
|
@ -315,14 +315,12 @@ fn create_all_platforms()
|
||||||
-> HashMap<String, Box<dyn crate::platform::PlatformClient>> {
|
-> HashMap<String, Box<dyn crate::platform::PlatformClient>> {
|
||||||
let mut platforms = HashMap::new();
|
let mut platforms = HashMap::new();
|
||||||
|
|
||||||
if let Ok(platform) = create_platform("modrinth", None) {
|
let curseforge_key = std::env::var("CURSEFORGE_API_KEY").ok();
|
||||||
|
if let Ok(platform) = create_platform("multiplatform", curseforge_key) {
|
||||||
|
platforms.insert("multiplatform".to_string(), platform);
|
||||||
|
} else if let Ok(platform) = create_platform("modrinth", None) {
|
||||||
platforms.insert("modrinth".to_string(), platform);
|
platforms.insert("modrinth".to_string(), platform);
|
||||||
}
|
}
|
||||||
if let Ok(platform) =
|
|
||||||
create_platform("curseforge", std::env::var("CURSEFORGE_API_KEY").ok())
|
|
||||||
{
|
|
||||||
platforms.insert("curseforge".to_string(), platform);
|
|
||||||
}
|
|
||||||
if let Ok(platform) =
|
if let Ok(platform) =
|
||||||
create_platform("github", std::env::var("GITHUB_TOKEN").ok())
|
create_platform("github", std::env::var("GITHUB_TOKEN").ok())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue