Skip to content

Commit

Permalink
Fixing trimming to show installed versions without kubectl-
Browse files Browse the repository at this point in the history
  • Loading branch information
simplyzee committed Sep 12, 2019
1 parent 7963578 commit 298fee1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"io/ioutil"
"log"
"os"
"strings"

"github.com/spf13/cobra"
)
Expand Down Expand Up @@ -65,8 +66,8 @@ func ListKubectlBinaries() error {
// iterate and print files inside the kubemngr directory
for _, files := range kubectl {
file := files.Name()
// version := file[:strings.IndexByte(file, '-')]
fmt.Println(file)
version := strings.Replace(file, "kubectl-", "", -1)
fmt.Println(version)
}

return nil
Expand Down

0 comments on commit 298fee1

Please sign in to comment.