Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
dca493bfdc |
8
main.go
8
main.go
@@ -105,6 +105,11 @@ $ gowebbuild replace *.go foo bar
|
||||
Value: "./",
|
||||
Usage: "folder to serve",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "src",
|
||||
Value: "./",
|
||||
Usage: "folder to watch for changes and trigger live reload",
|
||||
},
|
||||
&cli.UintFlag{
|
||||
Name: "port",
|
||||
Value: uint(8080),
|
||||
@@ -119,6 +124,7 @@ $ gowebbuild replace *.go foo bar
|
||||
Action: func(ctx *cli.Context) error {
|
||||
port := ctx.Uint("port")
|
||||
root := ctx.String("root")
|
||||
src := ctx.String("src")
|
||||
lrPort := ctx.Uint("lr-port")
|
||||
|
||||
if lrPort != 0 {
|
||||
@@ -127,7 +133,7 @@ $ gowebbuild replace *.go foo bar
|
||||
w.SetMaxEvents(1)
|
||||
w.FilterOps(watcher.Write, watcher.Rename, watcher.Move, watcher.Create, watcher.Remove)
|
||||
|
||||
if err := w.AddRecursive(root); err != nil {
|
||||
if err := w.AddRecursive(src); err != nil {
|
||||
fmt.Println(err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
|
Reference in New Issue
Block a user