-
Notifications
You must be signed in to change notification settings - Fork 2
/
anko.go
47 lines (36 loc) · 913 Bytes
/
anko.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
47
package main
import (
"runtime"
"github.com/GuilhermeCaruso/anko/internal/banner"
"github.com/GuilhermeCaruso/anko/internal/configuration"
"github.com/GuilhermeCaruso/anko/internal/watcher"
)
var (
done = make(chan bool)
dispatcher = make(chan string)
isOpen = true
)
func main() {
config, err := configuration.Init()
if err != nil {
banner.Error(err.Error())
return
}
banner.Intro()
banner.SettingUp()
w := watcher.New(watcher.Watcher{
Files: config.Application.Watch.Files,
Extensions: config.Application.Watch.Extensions,
RootPath: config.Application.RootPath,
DispatcherChan: dispatcher,
DoneChan: done,
IsOpen: &isOpen,
AppPath: config.Application.ExecPath,
Language: config.Application.Language,
SysOS: runtime.GOOS,
})
banner.Listening()
go w.WatchForChange()
go w.AppController()
<-done
}