Closed zackproser closed 3 years ago
Do you also need to update https://github.com/gruntwork-io/git-xargs/blob/master/.circleci/config.yml?
Yes, thank you! Done in 8af5012
Fixes #18
@mmlb Please have a look and let me know if this is what you had in mind. Thanks!
Yep, thanks.
This is needed in addition to the small PR that I just merged: https://github.com/gruntwork-io/git-xargs/pull/14. I realized that after it was merged.
If you now run go get -u -v github.com/gruntwork-io/git-xargs/cmd
against https://github.com/gruntwork-io/git-xargs/releases/tag/v0.0.4, it "works", but the binary is now cmd
:D
Example:
$ cmd --help
Usage: cmd [--loglevel] [--github-org] [--dry-run] [--skip-pull-requests] [--repo] [--repos] [--branch-name]
[--commit-message] [--pull-request-title] [--pull-request-description] [--help] command [options] [args]
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.
Commands:
help, h Shows a list of commands or help for one command
$ which cmd
/Users/<my-user>/go/bin/cmd
Why is the folder called
cmd
in the first place?In our other CLI tools, we typically put
main.go
in the root of the repo, and the packages it depends on within folders. There might be a package called, say,cli
orcmd
that contains the core logic for parsing CLI args and executing code, agit
package for the Git functionality, and so on.If we put
main.go
in the root, would callinggo get github.com/gruntwork-io/git-xargs
do what we want?
@brikis98 I've seen both patterns. Some repos do what you mention, and some put it in cmd/<name-of-binary>
. Here's some examples:
Both work, it's just a matter of preference.
Why is the folder called
cmd
in the first place?In our other CLI tools, we typically put
main.go
in the root of the repo, and the packages it depends on within folders. There might be a package called, say,cli
orcmd
that contains the core logic for parsing CLI args and executing code, agit
package for the Git functionality, and so on.If we put
main.go
in the root, would callinggo get github.com/gruntwork-io/git-xargs
do what we want?
@brikis98 Raised this discussion internally yesterday - the cmd
folder originally came from this layout: https://github.com/golang-standards/project-layout#cmd and then we carried that to certain projects including kubergrunt.
That said, it's not required, and personally I'd prefer to drop the cmd
path entirely - because the other reason this is tripping some folks up is that they're used to being able to check out a repo and run go build
in the root, which you also can't currently do.
I agree calling go get github.com/gruntwork-io/git-xargs
would be the ideal.
Dropping the cmd/ subfolder entirely works for me too, I was mostly interested in not having a binary named cmd
in my GOPATH :smile:
Rearranged everything so that:
go build
works from the root directory as expectedgo test -v ./...
passes go get github.com/gruntwork-io/git-xargs
@brikis98 @yorinasub17 please have a look when you have time
@brikis98 Feedback implemented. Thank you!
Need to dig into test failures.
Don't forget to pull in the latest from master
and merging it, since all the file paths have changed!
Don't forget to pull in the latest from
master
and merging it, since all the file paths have changed!
Did thanks - rebased and now have it all passing again @brikis98 :pray:
Thanks for the reviews! Going to merge this in now.
Was looking forward for this to be merged so that go get …
can be used to install binary, but it seems like that it hasn't been released yet so that go get …
doesn't do the thing yet — what is the ETA for this feature to be released please?
Oh, nevermind me — have just seen v0.0.5
was released :partying_face:
Fixes https://github.com/gruntwork-io/git-xargs/issues/18 Fixes #7
@mmlb Please have a look and let me know if this is what you had in mind. Thanks!
Updates project layout which will allow for installing
git-xargs
with a single call togo get github.com/gruntwork-io/git-xargs
.