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