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
This commit is contained in:
Rob B 2023-07-09 22:22:24 -05:00 committed by GitHub
parent 5188ba2169
commit 15fd3eb497
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 3 deletions

View file

@ -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). 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 ## Troubleshooting
* Config files are located in `%APPDATA%\ficsit\` * Profile and installation records are located in `%APPDATA%\ficsit\`
* Cached downloads are located at `%LOCALAPPDATA%\ficsit\downloadCache` * Downloads are cached in `%LOCALAPPDATA%\ficsit\downloadCache\`
## Development ## Development

View file

@ -16,7 +16,7 @@ var cliCmd = &cobra.Command{
log.Info(). log.Info().
Str("version", viper.GetString("version")). Str("version", viper.GetString("version")).
Str("commit", viper.GetString("commit")). Str("commit", viper.GetString("commit")).
Msg("initialized") Msg("interactive cli initialized")
global, err := cli.InitCLI(false) global, err := cli.InitCLI(false)
if err != nil { if err != nil {

View file

@ -95,6 +95,15 @@ func (m installedModsList) LoadModData() {
}) })
go func() { 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)) references := make([]string, len(currentProfile.Mods))
i := 0 i := 0
for reference := range currentProfile.Mods { for reference := range currentProfile.Mods {