Skip to content

Commit

Permalink
fix: create config if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Dec 29, 2023
1 parent a1d0692 commit 9f8e4f5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/internal/repository/settings/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func FromPath(directory string) (*File, error) {
DirPath: directory,
Name: "settings.json",
}
err := file.Read()
return &file, err
if file.Read() != nil {
err := file.Write()
if err != nil {
return nil, err
}
}
return &file, nil
}

0 comments on commit 9f8e4f5

Please sign in to comment.