-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
46 lines (42 loc) · 960 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
config "github.com/prodyna/github-users/config"
"github.com/prodyna/github-users/userlist"
"log/slog"
"os"
)
func main() {
c, err := config.New()
if err != nil {
slog.Error("Unable to create config", "error", err)
os.Exit(1)
}
ulc := userlist.New(
userlist.WithAction(c.Action),
userlist.WithEnterprise(c.Enterprise),
userlist.WithGithubToken(c.GithubToken),
userlist.WithTemplateFiles(c.TemplateFiles),
userlist.WithOutputFiles(c.OutputFiles),
userlist.WithOwnDomains(c.OwnDomains),
)
err = ulc.Validate()
if err != nil {
slog.Error("Invalid config", "error", err)
os.Exit(1)
}
err = ulc.Load()
if err != nil {
slog.Error("Unable to load userlist", "error", err)
os.Exit(1)
}
err = ulc.Print()
if err != nil {
slog.Error("Unable to print userlist", "error", err)
os.Exit(1)
}
err = ulc.Render()
if err != nil {
slog.Error("Unable to render userlist", "error", err)
os.Exit(1)
}
}