-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.go
More file actions
29 lines (21 loc) · 654 Bytes
/
main.go
File metadata and controls
29 lines (21 loc) · 654 Bytes
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
package main
import (
"github.com/jasondavindev/hacktoberfest-2020/command"
"github.com/jasondavindev/hacktoberfest-2020/config"
"github.com/jasondavindev/hacktoberfest-2020/listener"
)
func main() {
configPath := config.CfgFilePath()
cfg := config.CfgFactory(configPath)
directoryWatch := cfg.Directory
excludedDirectories := cfg.Exclude
commands := cfg.Commands
jr := command.CreateJobRunner(commands)
cl := listener.CreateChangesListener(excludedDirectories, jr)
listener.RunCommandsAndFormatResponse(&jr)
defer cl.CloseWatcher()
done := make(chan bool)
go cl.ListenEvents()
cl.SetupDirectoriesToWatch(directoryWatch)
<-done
}