From 15fd3eb497b5ca7a48ed7047d4932e59a6007aae Mon Sep 17 00:00:00 2001 From: Rob B Date: Sun, 9 Jul 2023 22:22:24 -0500 Subject: [PATCH] fix: stop unrelated mod data appearing in Installed Mods screen (#28) * chore: readme update to include relevant paths * chore: clarify log message * fix: stop loading unrelated mod data in Installed Mods screen when no mods are installed --- README.md | 14 ++++++++++++-- cmd/cli.go | 2 +- tea/scenes/mods/installed_mods.go | 9 +++++++++ 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index af33330..cdc7c62 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,20 @@ Download the appropriate `.apk` for your CPU architecture. Download the "all" build [here](https://github.com/Vilsol/ficsit-cli/releases/latest/download/ficsit_darwin_all). +## Usage + +### Interactive CLI + +To launch the interactive CLI, run the executable without any arguments. + +### Command Line + +Run `ficsit help` to see a list of available commands. + ## Troubleshooting -* Config files are located in `%APPDATA%\ficsit\` -* Cached downloads are located at `%LOCALAPPDATA%\ficsit\downloadCache` +* Profile and installation records are located in `%APPDATA%\ficsit\` +* Downloads are cached in `%LOCALAPPDATA%\ficsit\downloadCache\` ## Development diff --git a/cmd/cli.go b/cmd/cli.go index f31ed79..8157258 100644 --- a/cmd/cli.go +++ b/cmd/cli.go @@ -16,7 +16,7 @@ var cliCmd = &cobra.Command{ log.Info(). Str("version", viper.GetString("version")). Str("commit", viper.GetString("commit")). - Msg("initialized") + Msg("interactive cli initialized") global, err := cli.InitCLI(false) if err != nil { diff --git a/tea/scenes/mods/installed_mods.go b/tea/scenes/mods/installed_mods.go index 08b83b1..e5cee13 100644 --- a/tea/scenes/mods/installed_mods.go +++ b/tea/scenes/mods/installed_mods.go @@ -95,6 +95,15 @@ func (m installedModsList) LoadModData() { }) go func() { + if len(currentProfile.Mods) == 0 { + m.items <- listUpdate{ + Items: items, + Done: true, + } + return + // Continuing past this point would load info about mods we don't have installed + } + references := make([]string, len(currentProfile.Mods)) i := 0 for reference := range currentProfile.Mods {