mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user