Skip to content

Commit

Permalink
fix: Fix plugin version output (#233)
Browse files Browse the repository at this point in the history
* fix: Fix plugin version output

* fix: Rm unsued import
  • Loading branch information
dsimansk authored Dec 2, 2020
1 parent 557361a commit 8a30ba1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"github.com/boson-project/faas/cmd"
"knative.dev/client/pkg/kn/plugin"
"os"
"runtime/debug"
"strings"
)

func init() {
Expand All @@ -17,7 +19,13 @@ func (f *faasPlugin) Name() string {
}

func (f *faasPlugin) Execute(args []string) error {
rootCmd := cmd.NewRootCmd()
rootCmd := cmd.NewRootCmd()
info, _ := debug.ReadBuildInfo()
for _, dep := range info.Deps {
if strings.Contains(dep.Path, "boson-project/faas") {
cmd.SetMeta("", dep.Version, dep.Sum)
}
}
oldArgs := os.Args
defer (func() {
os.Args = oldArgs
Expand Down

0 comments on commit 8a30ba1

Please sign in to comment.