Skip to content

Commit

Permalink
Merge pull request #106 from profelis/master
Browse files Browse the repository at this point in the history
list only sub folders as installed versions (ignoring any other files)
  • Loading branch information
tristanisham authored Dec 3, 2024
2 parents cc88a7c + 0ea06c4 commit 827b782
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cli/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ func (z *ZVM) GetInstalledVersions() ([]string, error) {
}
versions := make([]string, 0, len(dir))
for _, key := range dir {
switch key.Name() {
case "settings.json", "bin", "versions.json", "versions-zls.json", "self":
continue
default:
versions = append(versions, key.Name())
if key.Type().IsDir() {
switch key.Name() {
case "bin", "self":
continue
default:
versions = append(versions, key.Name())
}
}
}
return versions, nil
Expand Down

0 comments on commit 827b782

Please sign in to comment.