-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go.old
51 lines (46 loc) · 1.05 KB
/
main.go.old
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
48
49
50
51
package main
import (
// "fmt"
// "github.com/radovskyb/watcher"
// "blank.com/framework/functions"
"github.com/yuin/gopher-lua"
// "log"
// "time"
)
func main2() {
L := lua.NewState()
// w := watcher.New()
defer L.Close()
// w.IgnoreHiddenFiles(true)
// w.FilterOps(watcher.Rename, watcher.Write)
//
L.SetGlobal("square", L.NewFunction(square))
L.SetGlobal("hunker", L.NewFunction(hunker))
//
// go func() {
// for {
// select {
// case event := <-w.Event:
// // if (event.Op == "WRITE") || (event.Op == "RENAME") {
// fmt.Println(event.Path) // Print the event's info.
// // }
// case err := <-w.Error:
// log.Fatalln(err)
// case <-w.Closed:
// return
// }
// }
// }()
//
// // Watch this folder for changes.
// if err := w.Add("config"); err != nil {
// log.Fatalln(err)
// }
// Start the watching process - it'll check for changes every 100ms.
// if err := w.Start(time.Millisecond * 100); err != nil {
// log.Fatalln(err)
// }
if err := L.DoFile("config/config.lua"); err != nil {
panic(err)
}
}