Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display correct remote in buf login #752

Merged
merged 2 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Change message documentation for fields to be either a single field or a oneof set of fields. This is a breaking API change.
- Use a separate repository service to for each dependency remote to resolve dependencies for `buf mod update`. Previously, we used a single repository service based on the remote
from the module, so it was unable to resolve dependencies from differente remotes.
- Display the user-provided Buf Schema Registry remote, if specified, instead of the default within the `buf login` message.

## [v1.0.0-rc8] - 2021-11-10

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,15 @@ func run(
container appflag.Container,
flags *flags,
) error {
remote := bufrpc.DefaultRemote
if container.NumArgs() == 1 {
remote = container.Arg(0)
}
// Do not print unless we are prompting
if flags.Username == "" && !flags.TokenStdin {
loginMessage := fmt.Sprintf("Login with your Buf Schema Registry username. If you don't have a username, head over to https://%s to create one.\n\n", remote)
lrewega marked this conversation as resolved.
Show resolved Hide resolved
if _, err := container.Stdout().Write(
[]byte("Login with your Buf Schema Registry username. If you don't have a username, head over to https://buf.build to create one.\n\n"),
[]byte(loginMessage),
); err != nil {
return err
}
Expand Down Expand Up @@ -122,10 +127,6 @@ func run(
return err
}
}
remote := bufrpc.DefaultRemote
if container.NumArgs() == 1 {
remote = container.Arg(0)
}
if err := netrc.PutMachines(
container,
netrc.NewMachine(
Expand Down