You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a repository that contains more than 20 commands, in which sometimes I want to build only one command to save time.
And it looks like grapi offers a way to do that like grapi build <command name> but this doesn't work
$ grapi build server
▸ Building server
can't load package: named files must be .go files: server
failed to build [/Users/potsbo/.go/src/github.com/<repo-slug>/cmd/server/main.go /Users/potsbo/.go/src/github.com/<repo-slug>/cmd/server/run.go]: exit status 1
Since grapi passes the args I give as an arg to the go build command, the go command receives an unexpected arg.
WHAT
I would like to fix this problem by doing below
not to take args in Build func
not to add the args into go build args
But before doing that I would like to know your intention of this code.
Maybe you wanted to let users to pass build args to go? But this doesn't work because cobra doesn't let us passing args other than specified ones, which means this cannot be done in the current architecture.
$ grapi build server -a
unknown shorthand flag: 'a' in -a
WHY
I have a repository that contains more than 20 commands, in which sometimes I want to build only one command to save time.
And it looks like
grapi
offers a way to do that likegrapi build <command name>
but this doesn't workI did a bit of investigation to find out the cause is https://github.com/izumin5210/grapi/blob/master/pkg/grapicmd/internal/module/script/script.go#L67
Since
grapi
passes the args I give as an arg to thego build
command, thego
command receives an unexpected arg.WHAT
I would like to fix this problem by doing below
Build
funcgo build
argsBut before doing that I would like to know your intention of this code.
Maybe you wanted to let users to pass build args to
go
? But this doesn't work becausecobra
doesn't let us passing args other than specified ones, which means this cannot be done in the current architecture.Any suggestion? @izumin5210
The text was updated successfully, but these errors were encountered: