-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bcfdeb
commit f19dd6e
Showing
8 changed files
with
80 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
package teksturepako.pakku | ||
|
||
const val VERSION = "0.0.7" | ||
const val VERSION = "0.0.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package teksturepako.pakku.cli.cmd | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import com.github.ajalt.clikt.core.terminal | ||
import kotlinx.coroutines.runBlocking | ||
import teksturepako.pakku.api.data.PakkuLock | ||
|
||
class Init : CliktCommand("Initialize modpack") | ||
{ | ||
override fun run() = runBlocking { | ||
if (PakkuLock.exists()) | ||
{ | ||
terminal.danger("Modpack is already initialized") | ||
terminal.info("To change already initialized properties, use the command: \"set\"") | ||
echo() | ||
return@runBlocking | ||
} | ||
|
||
val pakkuLock = PakkuLock.readOrNew() | ||
|
||
val packName: String = | ||
terminal.prompt("? Modpack name") ?: "" | ||
|
||
pakkuLock.setPackName(packName) | ||
terminal.success("'name' set to '$packName'") | ||
|
||
val mcVersions: List<String> = | ||
terminal.prompt("? Minecraft versions")?.split(" ") ?: return@runBlocking | ||
|
||
pakkuLock.setMcVersions(mcVersions) | ||
terminal.success("'mc_version' set to $mcVersions") | ||
|
||
val loaders: List<String> = | ||
terminal.prompt("? Loaders")?.split(" ") ?: return@runBlocking | ||
|
||
pakkuLock.setModLoaders(loaders) | ||
terminal.success("'loaders' set to $loaders") | ||
|
||
val target: String = | ||
terminal.prompt("? Target", choices = listOf("curseforge", "modrinth", "multiplatform")) | ||
?: return@runBlocking | ||
|
||
pakkuLock.setPlatformTarget(target) | ||
terminal.success("'target' set to '$target'") | ||
|
||
echo() | ||
|
||
pakkuLock.write() | ||
terminal.success("Modpack successfully initialized") | ||
echo() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/commonMain/kotlin/teksturepako/pakku/cli/cmd/Version.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package teksturepako.pakku.cli.cmd | ||
|
||
import com.github.ajalt.clikt.core.CliktCommand | ||
import teksturepako.pakku.VERSION | ||
|
||
class Version : CliktCommand("Get pakku version") | ||
{ | ||
override fun run() | ||
{ | ||
echo("Pakku version $VERSION") | ||
echo() | ||
} | ||
} |