commit
345fde9c9a
@ -52,7 +52,7 @@ A Go build system with file watchers, output streams and live reload. Run, build
|
|||||||
--no-bin -> Disables the installation
|
--no-bin -> Disables the installation
|
||||||
--no-run -> Disables the run
|
--no-run -> Disables the run
|
||||||
--no-fmt -> Disables the fmt (go fmt)
|
--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
|
--open -> Open the web panel in a new browser window
|
||||||
```
|
```
|
||||||
Examples:
|
Examples:
|
||||||
|
@ -130,6 +130,7 @@ func main() {
|
|||||||
&cli.BoolFlag{Name: "no-server", Usage: "Disables the web panel"},
|
&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: "no-config", Value: false, Usage: "Uses the config settings"},
|
||||||
&cli.BoolFlag{Name: "open", Usage: "Automatically opens the web panel"},
|
&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"},
|
&cli.BoolFlag{Name: "test", Value: false, Usage: "Enables the tests"},
|
||||||
},
|
},
|
||||||
Action: func(p *cli.Context) error {
|
Action: func(p *cli.Context) error {
|
||||||
|
File diff suppressed because one or more lines are too long
@ -48,6 +48,9 @@ func render(c echo.Context, path string, mime int) error {
|
|||||||
|
|
||||||
// Start the web server
|
// Start the web server
|
||||||
func (s *Server) Start(p *cli.Context) (err error) {
|
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 {
|
if !p.Bool("no-server") && s.Enabled {
|
||||||
e := echo.New()
|
e := echo.New()
|
||||||
e.Use(middleware.Gzip())
|
e.Use(middleware.Gzip())
|
||||||
|
@ -3,6 +3,7 @@ package cli
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/fsnotify/fsnotify"
|
||||||
"log"
|
"log"
|
||||||
"math/big"
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
@ -13,8 +14,6 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/fsnotify/fsnotify"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Watching method is the main core. It manages the livereload and the watching
|
// Watching method is the main core. It manages the livereload and the watching
|
||||||
|
Loading…
Reference in New Issue
Block a user