#37 fixed
This commit is contained in:
parent
1301e832c7
commit
2aec84cb05
|
@ -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 {
|
||||||
|
|
|
@ -413,20 +413,20 @@ func AssetNames() []string {
|
||||||
|
|
||||||
// _bindata is a table, holding each asset generator, mapped to its name.
|
// _bindata is a table, holding each asset generator, mapped to its name.
|
||||||
var _bindata = map[string]func() (*asset, error){
|
var _bindata = map[string]func() (*asset, error){
|
||||||
"assets/app/components/index.html": assetsAppComponentsIndexHtml,
|
"assets/app/components/index.html": assetsAppComponentsIndexHtml,
|
||||||
"assets/app/components/project/index.html": assetsAppComponentsProjectIndexHtml,
|
"assets/app/components/project/index.html": assetsAppComponentsProjectIndexHtml,
|
||||||
"assets/app/components/projects/index.html": assetsAppComponentsProjectsIndexHtml,
|
"assets/app/components/projects/index.html": assetsAppComponentsProjectsIndexHtml,
|
||||||
"assets/assets/css/app.css": assetsAssetsCssAppCss,
|
"assets/assets/css/app.css": assetsAssetsCssAppCss,
|
||||||
"assets/assets/img/svg/github-logo.svg": assetsAssetsImgSvgGithubLogoSvg,
|
"assets/assets/img/svg/github-logo.svg": assetsAssetsImgSvgGithubLogoSvg,
|
||||||
"assets/assets/img/svg/ic_cached_black_48px.svg": assetsAssetsImgSvgIc_cached_black_48pxSvg,
|
"assets/assets/img/svg/ic_cached_black_48px.svg": assetsAssetsImgSvgIc_cached_black_48pxSvg,
|
||||||
"assets/assets/img/svg/ic_delete_sweep_black_48px.svg": assetsAssetsImgSvgIc_delete_sweep_black_48pxSvg,
|
"assets/assets/img/svg/ic_delete_sweep_black_48px.svg": assetsAssetsImgSvgIc_delete_sweep_black_48pxSvg,
|
||||||
"assets/assets/img/svg/ic_error_black_48px.svg": assetsAssetsImgSvgIc_error_black_48pxSvg,
|
"assets/assets/img/svg/ic_error_black_48px.svg": assetsAssetsImgSvgIc_error_black_48pxSvg,
|
||||||
"assets/assets/img/svg/ic_file_download_black_48px.svg": assetsAssetsImgSvgIc_file_download_black_48pxSvg,
|
"assets/assets/img/svg/ic_file_download_black_48px.svg": assetsAssetsImgSvgIc_file_download_black_48pxSvg,
|
||||||
"assets/assets/img/svg/ic_more_vert_black_48px.svg": assetsAssetsImgSvgIc_more_vert_black_48pxSvg,
|
"assets/assets/img/svg/ic_more_vert_black_48px.svg": assetsAssetsImgSvgIc_more_vert_black_48pxSvg,
|
||||||
"assets/assets/img/svg/ic_swap_vertical_circle_black_48px.svg": assetsAssetsImgSvgIc_swap_vertical_circle_black_48pxSvg,
|
"assets/assets/img/svg/ic_swap_vertical_circle_black_48px.svg": assetsAssetsImgSvgIc_swap_vertical_circle_black_48pxSvg,
|
||||||
"assets/assets/js/all.js": assetsAssetsJsAllJs,
|
"assets/assets/js/all.js": assetsAssetsJsAllJs,
|
||||||
"assets/assets/js/all.min.js": assetsAssetsJsAllMinJs,
|
"assets/assets/js/all.min.js": assetsAssetsJsAllMinJs,
|
||||||
"assets/index.html": assetsIndexHtml,
|
"assets/index.html": assetsIndexHtml,
|
||||||
}
|
}
|
||||||
|
|
||||||
// AssetDir returns the file names below a certain
|
// AssetDir returns the file names below a certain
|
||||||
|
@ -468,40 +468,41 @@ type bintree struct {
|
||||||
Func func() (*asset, error)
|
Func func() (*asset, error)
|
||||||
Children map[string]*bintree
|
Children map[string]*bintree
|
||||||
}
|
}
|
||||||
|
|
||||||
var _bintree = &bintree{nil, map[string]*bintree{
|
var _bintree = &bintree{nil, map[string]*bintree{
|
||||||
"assets": &bintree{nil, map[string]*bintree{
|
"assets": {nil, map[string]*bintree{
|
||||||
"app": &bintree{nil, map[string]*bintree{
|
"app": {nil, map[string]*bintree{
|
||||||
"components": &bintree{nil, map[string]*bintree{
|
"components": {nil, map[string]*bintree{
|
||||||
"index.html": &bintree{assetsAppComponentsIndexHtml, map[string]*bintree{}},
|
"index.html": {assetsAppComponentsIndexHtml, map[string]*bintree{}},
|
||||||
"project": &bintree{nil, map[string]*bintree{
|
"project": {nil, map[string]*bintree{
|
||||||
"index.html": &bintree{assetsAppComponentsProjectIndexHtml, map[string]*bintree{}},
|
"index.html": {assetsAppComponentsProjectIndexHtml, map[string]*bintree{}},
|
||||||
}},
|
}},
|
||||||
"projects": &bintree{nil, map[string]*bintree{
|
"projects": {nil, map[string]*bintree{
|
||||||
"index.html": &bintree{assetsAppComponentsProjectsIndexHtml, map[string]*bintree{}},
|
"index.html": {assetsAppComponentsProjectsIndexHtml, map[string]*bintree{}},
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
"assets": &bintree{nil, map[string]*bintree{
|
"assets": {nil, map[string]*bintree{
|
||||||
"css": &bintree{nil, map[string]*bintree{
|
"css": {nil, map[string]*bintree{
|
||||||
"app.css": &bintree{assetsAssetsCssAppCss, map[string]*bintree{}},
|
"app.css": {assetsAssetsCssAppCss, map[string]*bintree{}},
|
||||||
}},
|
}},
|
||||||
"img": &bintree{nil, map[string]*bintree{
|
"img": {nil, map[string]*bintree{
|
||||||
"svg": &bintree{nil, map[string]*bintree{
|
"svg": {nil, map[string]*bintree{
|
||||||
"github-logo.svg": &bintree{assetsAssetsImgSvgGithubLogoSvg, map[string]*bintree{}},
|
"github-logo.svg": {assetsAssetsImgSvgGithubLogoSvg, map[string]*bintree{}},
|
||||||
"ic_cached_black_48px.svg": &bintree{assetsAssetsImgSvgIc_cached_black_48pxSvg, map[string]*bintree{}},
|
"ic_cached_black_48px.svg": {assetsAssetsImgSvgIc_cached_black_48pxSvg, map[string]*bintree{}},
|
||||||
"ic_delete_sweep_black_48px.svg": &bintree{assetsAssetsImgSvgIc_delete_sweep_black_48pxSvg, map[string]*bintree{}},
|
"ic_delete_sweep_black_48px.svg": {assetsAssetsImgSvgIc_delete_sweep_black_48pxSvg, map[string]*bintree{}},
|
||||||
"ic_error_black_48px.svg": &bintree{assetsAssetsImgSvgIc_error_black_48pxSvg, map[string]*bintree{}},
|
"ic_error_black_48px.svg": {assetsAssetsImgSvgIc_error_black_48pxSvg, map[string]*bintree{}},
|
||||||
"ic_file_download_black_48px.svg": &bintree{assetsAssetsImgSvgIc_file_download_black_48pxSvg, map[string]*bintree{}},
|
"ic_file_download_black_48px.svg": {assetsAssetsImgSvgIc_file_download_black_48pxSvg, map[string]*bintree{}},
|
||||||
"ic_more_vert_black_48px.svg": &bintree{assetsAssetsImgSvgIc_more_vert_black_48pxSvg, map[string]*bintree{}},
|
"ic_more_vert_black_48px.svg": {assetsAssetsImgSvgIc_more_vert_black_48pxSvg, map[string]*bintree{}},
|
||||||
"ic_swap_vertical_circle_black_48px.svg": &bintree{assetsAssetsImgSvgIc_swap_vertical_circle_black_48pxSvg, map[string]*bintree{}},
|
"ic_swap_vertical_circle_black_48px.svg": {assetsAssetsImgSvgIc_swap_vertical_circle_black_48pxSvg, map[string]*bintree{}},
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
"js": &bintree{nil, map[string]*bintree{
|
"js": {nil, map[string]*bintree{
|
||||||
"all.js": &bintree{assetsAssetsJsAllJs, map[string]*bintree{}},
|
"all.js": {assetsAssetsJsAllJs, map[string]*bintree{}},
|
||||||
"all.min.js": &bintree{assetsAssetsJsAllMinJs, map[string]*bintree{}},
|
"all.min.js": {assetsAssetsJsAllMinJs, map[string]*bintree{}},
|
||||||
}},
|
}},
|
||||||
}},
|
}},
|
||||||
"index.html": &bintree{assetsIndexHtml, map[string]*bintree{}},
|
"index.html": {assetsIndexHtml, map[string]*bintree{}},
|
||||||
}},
|
}},
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
@ -551,4 +552,3 @@ func _filePath(dir, name string) string {
|
||||||
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
cannonicalName := strings.Replace(name, "\\", "/", -1)
|
||||||
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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