Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions cmd/entire/cli/integration_test/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ func waitForLoginPrompt(t *testing.T, stdout *bufio.Reader) (string, string) {
switch {
case strings.HasPrefix(line, "Device code: "):
deviceCode = strings.TrimPrefix(line, "Device code: ")
case strings.HasPrefix(line, "Approval URL: "):
approvalURL = strings.TrimPrefix(line, "Approval URL: ")
case strings.HasPrefix(line, "Login URL:"):
approvalURL = strings.TrimSpace(strings.TrimPrefix(line, "Login URL:"))
}

if approvalURL != "" && deviceCode != "" {
Expand Down
9 changes: 5 additions & 4 deletions cmd/entire/cli/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ func runLogin(ctx context.Context, outW, errW io.Writer, client deviceAuthClient
// so opening the URL is usually all the user needs to do. The device
// code is printed above regardless, so it's still available to confirm
// against the page (RFC 8628 §3.3.1) or to enter on the bare-URI fallback.
fmt.Fprintf(outW, "Press Enter to open %s in your browser to approve this login...", approvalURL)
fmt.Fprintf(outW, "Login URL: %s\n\n", approvalURL)
fmt.Fprintf(outW, "Press Enter to open in browser...")

// Read from /dev/tty so we get a real keypress and don't consume piped stdin.
if err := waitForEnter(ctx); err != nil {
Expand All @@ -91,10 +92,10 @@ func runLogin(ctx context.Context, outW, errW io.Writer, client deviceAuthClient
fmt.Fprintf(outW, "Open this URL in your browser to approve this login: %s\n", approvalURL)
}
} else {
fmt.Fprintf(outW, "Approval URL: %s\n", approvalURL)
fmt.Fprintf(outW, "Login URL: %s\n\n", approvalURL)
Comment thread
toothbrush marked this conversation as resolved.
}

fmt.Fprintln(outW, "Waiting for approval...")
fmt.Fprint(outW, "Waiting for approval... ")

token, refreshToken, err := waitForApproval(ctx, client, start.DeviceCode, start.ExpiresIn, time.Duration(start.Interval)*time.Second, defaultSlowDownBackoff)
if err != nil {
Expand Down Expand Up @@ -123,7 +124,7 @@ func runLogin(ctx context.Context, outW, errW io.Writer, client deviceAuthClient
fmt.Fprintf(errW, "Warning: logged in, but could not record a shareable context (clone via entire:// may need a re-login): %v\n", err)
}

fmt.Fprintln(outW, "Login complete.")
fmt.Fprintln(outW, "Login complete.")
return nil
}

Expand Down
10 changes: 9 additions & 1 deletion mise-tasks/dev/publish
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,12 @@ set -eu
export GOBIN=${GOPATH:-$HOME/go}/bin
echo "NOTE: we're overriding \$GOBIN: $GOBIN" 1>&2

go install ./cmd/entire ./cmd/git-remote-entire
commands=(
entire
git-remote-entire
)

for c in "${commands[@]}"; do
go install "./cmd/$c"
echo "Installed: '$c'" 1>&2
done
Loading