Skip to content

Commit

Permalink
Revert "fix api and ctrl not working well."
Browse files Browse the repository at this point in the history
This reverts commit bfc87d2.
  • Loading branch information
joy999 committed Oct 25, 2023
1 parent d0bf90f commit ad9409f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/gf/internal/cmd/genpb/genpb.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import (
type (
CGenPb struct{}
CGenPbInput struct {
g.Meta `name:"pb" config:"{CGenPbConfig}" brief:"{CGenPbBrief}" eg:"{CGenPbEg}"`
Path string `name:"path" short:"p" dc:"protobuf file folder path" d:"manifest/protobuf"`
Api string `name:"api" short:"a" dc:"output folder path storing generated go files of api" d:"api"`
Ctrl string `name:"ctrl" short:"c" dc:"output folder path storing generated go files of controller" d:"internal/controller"`
g.Meta `name:"pb" config:"{CGenPbConfig}" brief:"{CGenPbBrief}" eg:"{CGenPbEg}"`
Path string `name:"path" short:"p" dc:"protobuf file folder path" d:"manifest/protobuf"`
OutputApi string `name:"api" short:"a" dc:"output folder path storing generated go files of api" d:"api"`
OutputCtrl string `name:"ctrl" short:"c" dc:"output folder path storing generated go files of controller" d:"internal/controller"`
}
CGenPbOutput struct{}
)
Expand Down Expand Up @@ -68,20 +68,20 @@ func (c CGenPb) Pb(ctx context.Context, in CGenPbInput) (out *CGenPbOutput, err
}
}
// output path checks.
outputApiPath := gfile.RealPath(in.Api)
outputApiPath := gfile.RealPath(in.OutputApi)
if outputApiPath == "" {
if isParsingPWD {
outputApiPath = protoPath
} else {
mlog.Fatalf(`output api folder "%s" does not exist`, in.Api)
mlog.Fatalf(`output api folder "%s" does not exist`, in.OutputApi)
}
}
outputCtrlPath := gfile.RealPath(in.Ctrl)
outputCtrlPath := gfile.RealPath(in.OutputCtrl)
if outputCtrlPath == "" {
if isParsingPWD {
outputCtrlPath = ""
} else {
mlog.Fatalf(`output controller folder "%s" does not exist`, in.Ctrl)
mlog.Fatalf(`output controller folder "%s" does not exist`, in.OutputCtrl)
}
}

Expand Down

0 comments on commit ad9409f

Please sign in to comment.