User Input (#119)

Port the User Input feature from the previous version of the app. This
is currently being used to verify a few different prompts for ssh.
This commit is contained in:
Sylvie Crowe
2024-07-18 15:21:33 -07:00
committed by GitHub
parent 01d61dabec
commit f3743f90ec
16 changed files with 438 additions and 126 deletions
+2 -2
View File
@@ -40,13 +40,13 @@ type WatcherUpdate struct {
func readFileContents(filePath string, getDefaults func() SettingsConfigType) (*SettingsConfigType, error) {
if getDefaults == nil {
log.Printf("oopsie")
log.Printf("should not happen")
return nil, fmt.Errorf("watcher started without defaults")
}
content := getDefaults()
data, err := os.ReadFile(filePath)
if err != nil {
log.Printf("doopsie: %v", err)
log.Printf("could not read settings file: %v", err)
return nil, err
}
if err := json.Unmarshal(data, &content); err != nil {