Skip to content

Commit 173e790

Browse files
fix: infinite loop (#90)
1 parent 6bcf3d1 commit 173e790

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cmd/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,10 @@ func setupDatabaseConfig() config.DatabaseConfig {
15111511
fmt.Print("Username is required. Database username: ")
15121512
if scanner.Scan() {
15131513
username = strings.TrimSpace(scanner.Text())
1514+
} else {
1515+
// Handle EOF or input error - exit gracefully
1516+
fmt.Printf("\nError: Unable to read input. Setup cancelled.\n")
1517+
os.Exit(1)
15141518
}
15151519
}
15161520

pkg/database/setup_wizard.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ func (w *SetupWizard) setupConnectionSettings(config *ProviderConfig) {
143143
fmt.Print("Username is required. Database username: ")
144144
if w.scanner.Scan() {
145145
username = strings.TrimSpace(w.scanner.Text())
146+
} else {
147+
// Handle EOF or input error - exit gracefully
148+
fmt.Printf("\nError: Unable to read input. Setup cancelled.\n")
149+
return
146150
}
147151
}
148152
config.Username = username

0 commit comments

Comments
 (0)