Skip to content

Commit f775287

Browse files
committed
Improve spinners for install and remove command
1 parent 8076cca commit f775287

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pacmc-cli/src/commonMain/kotlin/net/axay/pacmc/cli/commands/InstallCommand.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ class InstallCommand : CliktCommand(
2525
terminal.println("Resolving versions and dependencies...")
2626
val archive = Archive.terminalFromString(archiveName) ?: return@launchJob
2727

28+
val modIds = CliParser.resolveSlugs(modSlugNames) ?: return@launchJob
29+
2830
val spinner = SpinnerAnimation()
2931
spinner.start()
30-
val transaction = archive.resolve(CliParser.resolveSlugs(modSlugNames) ?: return@launchJob, spinner::update)
31-
spinner.stop()
32+
val transaction = archive.resolve(modIds, spinner::update)
33+
spinner.stop("resolved install transaction")
3234
terminal.println()
3335

3436
val modStrings = transaction.resolveModStrings()

pacmc-cli/src/commonMain/kotlin/net/axay/pacmc/cli/commands/RemoveCommand.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ class RemoveCommand : CliktCommand(
2626
terminal.println("Resolving effects of removal...")
2727
val archive = Archive.terminalFromString(archiveName) ?: return@launchJob
2828

29+
val modIds = CliParser.resolveSlugs(modSlugNames) ?: return@launchJob
30+
2931
val spinner = SpinnerAnimation()
3032
spinner.start()
31-
val removalResolveResult = archive.resolveRemoval(CliParser.resolveSlugs(modSlugNames) ?: return@launchJob, spinner::update)
32-
spinner.stop()
33+
val removalResolveResult = archive.resolveRemoval(modIds, spinner::update)
34+
spinner.stop("resolved remove transaction")
3335
terminal.println()
3436

3537
if (removalResolveResult.stillNeeded.isNotEmpty() || removalResolveResult.notInstalled.isNotEmpty()) {

0 commit comments

Comments
 (0)