Skip to content
This repository has been archived by the owner on Jun 11, 2023. It is now read-only.

Commit

Permalink
Allow disabling copying links
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverAndro committed Jun 11, 2022
1 parent ebe94c8 commit 3680dd6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ data class ModrinthProjectCreate private constructor(
) {
companion object {
fun of(curseforgeProject: CurseforgeProject): ModrinthProjectCreate {
val copyLinks = ModifoldArgs.args.donts.contains(DONT.COPY_LINKS).not()
return ModrinthProjectCreate(
title = curseforgeProject.name,
slug = curseforgeProject.slug,
Expand All @@ -41,10 +42,18 @@ data class ModrinthProjectCreate private constructor(
categories = if (ModifoldArgs.args.donts.contains(DONT.MAP_CATEGORIES)) emptyList() else mapCategories(
curseforgeProject.categories
),
discord_url = ModifoldArgs.args.discordServer.takeIf { it.isNotBlank() },
issues_url = curseforgeProject.links.issuesUrl?.takeIf { it.isNotBlank() },
source_url = curseforgeProject.links.sourceUrl?.takeIf { it.isNotBlank() },
wiki_url = curseforgeProject.links.wikiUrl?.takeIf { it.isNotBlank() }
discord_url = ModifoldArgs.args.discordServer.takeIf {
it.isNotBlank() && copyLinks
},
issues_url = curseforgeProject.links.issuesUrl?.takeIf {
it.isNotBlank() && copyLinks
},
source_url = curseforgeProject.links.sourceUrl?.takeIf {
it.isNotBlank() && copyLinks
},
wiki_url = curseforgeProject.links.wikiUrl?.takeIf {
it.isNotBlank() && copyLinks
}
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class ModifoldArgsContainer(parser: ArgParser) {
"pass 0 to disable startup confirm, " +
"1 to disable checking existing modrinth mods, " +
"2 to change the mcreator->cursed mapping to mcreator->misc, " +
"3 to disable category mapping entirely",
"3 to disable category mapping entirely, " +
"4 to disable copying links",
argName = "DONT_INDEX"
) { DONT.values()[toInt()] }

Expand Down Expand Up @@ -81,6 +82,7 @@ class ModifoldArgsContainer(parser: ArgParser) {
VERIFY_END_USER,
VERIFY_EXISTING,
CURSE_MCREATOR,
MAP_CATEGORIES
MAP_CATEGORIES,
COPY_LINKS
}
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = "com.github.p03w"
version = "2.1.3"
version = "2.1.4"

repositories {
mavenCentral()
Expand Down

0 comments on commit 3680dd6

Please sign in to comment.