Skip to content

Commit

Permalink
refactor (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingxt authored Dec 12, 2020
1 parent a0030b8 commit f919bc6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tools/goctl/plugin/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ const (
)

type Plugin struct {
Api *spec.ApiSpec
Style string
Dir string
Api *spec.ApiSpec
ApiFilePath string
Style string
Dir string
}

func PluginCommand(c *cli.Context) error {
Expand Down Expand Up @@ -86,6 +87,12 @@ func prepareArgs(c *cli.Context) ([]byte, error) {
transferData.Api = api
}

absApiFilePath, err := filepath.Abs(apiPath)
if err != nil {
return nil, err
}

transferData.ApiFilePath = absApiFilePath
dirAbs, err := filepath.Abs(c.String("dir"))
if err != nil {
return nil, err
Expand Down

0 comments on commit f919bc6

Please sign in to comment.