diff options
Diffstat (limited to 'steam/steam.go')
| -rw-r--r-- | steam/steam.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/steam/steam.go b/steam/steam.go index 7071a20..8c3dcbb 100644 --- a/steam/steam.go +++ b/steam/steam.go @@ -35,6 +35,23 @@ func ProcessMultipleLibraries(r []string) ([]*Library, error) { return libs, nil } +func NewLibrary(path string) (*Library, error) { + l := &Library{} + err := l.ProcessLibrary(path) + if err != nil { + return nil, err + } + return l, err +} + +func NewLibraryMust(path string) (*Library) { + l, err := NewLibrary(path) + if err != nil { + panic(err) + } + return l +} + // Populate the "Folder" and "Games" fields based on the provided directory func (s *Library) ProcessLibrary(r string) error { if !hasCommon(r) { |
