Skip to content

Commit b00c673

Browse files
committed
fix: print interactive prompts to stderr
1 parent 72697a0 commit b00c673

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

cmd/functions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ func PromptProjectRef(fsys afero.Fs) error {
145145
} else if err := utils.AssertIsLinkedFS(fsys); err == nil {
146146
return nil
147147
} else if strings.HasPrefix(err.Error(), "Cannot find project ref. Have you run") {
148-
fmt.Printf(`You can find your project ref from the project's dashboard home page, e.g. %s/project/<project-ref>.
148+
fmt.Fprintf(os.Stderr, `You can find your project ref from the project's dashboard home page, e.g. %s/project/<project-ref>.
149149
Enter your project ref: `, utils.GetSupabaseDashboardURL())
150150

151151
scanner := bufio.NewScanner(os.Stdin)

internal/link/link.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func updatePostgresConfig(conn *pgx.Conn) {
151151
}
152152

153153
func PromptPassword(stdin *os.File) string {
154-
fmt.Print("Enter your database password: ")
154+
fmt.Fprint(os.Stderr, "Enter your database password: ")
155155
bytepw, err := term.ReadPassword(int(stdin.Fd()))
156156
fmt.Println()
157157
if err != nil {

internal/login/login.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
func Run(stdin io.Reader, fsys afero.Fs) error {
18-
fmt.Printf(`You can generate an access token from %s/account/tokens
18+
fmt.Fprintf(os.Stderr, `You can generate an access token from %s/account/tokens
1919
Enter your access token: `, utils.GetSupabaseDashboardURL())
2020

2121
scanner := bufio.NewScanner(stdin)

0 commit comments

Comments
 (0)