Merge pull request #38 from tockins/dev

#37 fixed
This commit is contained in:
Alessio Pracchia 2016-12-19 23:31:12 +01:00 committed by GitHub
commit 345fde9c9a
5 changed files with 10 additions and 7 deletions

View File

@ -52,7 +52,7 @@ A Go build system with file watchers, output streams and live reload. Run, build
--no-bin -> Disables the installation
--no-run -> Disables the run
--no-fmt -> Disables the fmt (go fmt)
--no-server -> Disables the web panel (port :5000)
--no-server -> Disables the web panel (default port 5001)
--open -> Open the web panel in a new browser window
```
Examples:

View File

@ -130,6 +130,7 @@ func main() {
&cli.BoolFlag{Name: "no-server", Usage: "Disables the web panel"},
&cli.BoolFlag{Name: "no-config", Value: false, Usage: "Uses the config settings"},
&cli.BoolFlag{Name: "open", Usage: "Automatically opens the web panel"},
&cli.IntFlag{Name: "port", Usage: "Sets the web panel port"},
&cli.BoolFlag{Name: "test", Value: false, Usage: "Enables the tests"},
},
Action: func(p *cli.Context) error {

File diff suppressed because one or more lines are too long

View File

@ -48,6 +48,9 @@ func render(c echo.Context, path string, mime int) error {
// Start the web server
func (s *Server) Start(p *cli.Context) (err error) {
if p.Int("port") != 0 {
s.Settings.Server.Port = p.Int("port")
}
if !p.Bool("no-server") && s.Enabled {
e := echo.New()
e.Use(middleware.Gzip())

View File

@ -3,6 +3,7 @@ package cli
import (
"errors"
"fmt"
"github.com/fsnotify/fsnotify"
"log"
"math/big"
"os"
@ -13,8 +14,6 @@ import (
"sync"
"syscall"
"time"
"github.com/fsnotify/fsnotify"
)
// Watching method is the main core. It manages the livereload and the watching