Merge branch 'master' into develop

This commit is contained in:
Alessio Pracchia 2018-04-14 16:19:43 +02:00 committed by GitHub
commit e8235734df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 166 deletions

117
Gopkg.lock generated
View File

@ -1,117 +0,0 @@
# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
[[projects]]
name = "github.com/dgrijalva/jwt-go"
packages = ["."]
revision = "dbeaa9332f19a944acb5736b4456cfcc02140e29"
version = "v3.1.0"
[[projects]]
name = "github.com/fatih/color"
packages = ["."]
revision = "570b54cabe6b8eb0bc2dfce68d964677d63b5260"
version = "v1.5.0"
[[projects]]
name = "github.com/fsnotify/fsnotify"
packages = ["."]
revision = "629574ca2a5df945712d3079857300b5e4da0236"
version = "v1.4.2"
[[projects]]
name = "github.com/go-siris/siris"
packages = ["core/errors"]
revision = "d6bc3df4b216199bec985043ca6c3e5c00232fd5"
version = "v7.4.0"
[[projects]]
name = "github.com/labstack/echo"
packages = [".","middleware"]
revision = "0473c51f1dbd83487effce00702571d19033a6e5"
version = "3.2.5"
[[projects]]
name = "github.com/labstack/gommon"
packages = ["bytes","color","log","random"]
revision = "57409ada9da0f2afad6664c49502f8c50fbd8476"
version = "0.2.3"
[[projects]]
name = "github.com/mattn/go-colorable"
packages = ["."]
revision = "167de6bfdfba052fa6b2d3664c8f5272e23c9072"
version = "v0.0.9"
[[projects]]
name = "github.com/mattn/go-isatty"
packages = ["."]
revision = "0360b2af4f38e8d38c7fce2a9f4e702702d73a39"
version = "v0.0.3"
[[projects]]
branch = "master"
name = "github.com/satori/go.uuid"
packages = ["."]
revision = "5bf94b69c6b68ee1b541973bb8e1144db23a194b"
[[projects]]
name = "github.com/sirupsen/logrus"
packages = ["."]
revision = "d682213848ed68c0a260ca37d6dd5ace8423f5ba"
version = "v1.0.4"
[[projects]]
name = "github.com/tockins/interact"
packages = ["."]
revision = "f8fb5795b5d713c41dab6771ffe1fdfdfd0c3285"
version = "1.1.1"
[[projects]]
branch = "master"
name = "github.com/valyala/bytebufferpool"
packages = ["."]
revision = "e746df99fe4a3986f4d4f79e13c1e0117ce9c2f7"
[[projects]]
branch = "master"
name = "github.com/valyala/fasttemplate"
packages = ["."]
revision = "dcecefd839c4193db0d35b88ec65b4c12d360ab0"
[[projects]]
branch = "master"
name = "golang.org/x/crypto"
packages = ["acme","acme/autocert","ssh/terminal"]
revision = "94eea52f7b742c7cbe0b03b22f0c4c8631ece122"
[[projects]]
branch = "master"
name = "golang.org/x/net"
packages = ["websocket"]
revision = "d866cfc389cec985d6fda2859936a575a55a3ab6"
[[projects]]
branch = "master"
name = "golang.org/x/sys"
packages = ["unix","windows"]
revision = "d5840adf789d732bc8b00f37b26ca956a7cc8e79"
[[projects]]
branch = "v2"
name = "gopkg.in/urfave/cli.v2"
packages = ["."]
revision = "b2bf3c5abeb90da407891aecd1df2c5a1f6170c1"
[[projects]]
branch = "v2"
name = "gopkg.in/yaml.v2"
packages = ["."]
revision = "287cf08546ab5e7e37d55a84f7ed3fd1db036de5"
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "9a809196ffa8ff716d9be9eb2bc0342d0358b334fa50937a69a5c96bf60826f8"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -41,7 +41,7 @@
version = "1.0.4" version = "1.0.4"
[[constraint]] [[constraint]]
name = "github.com/tockins/interact" name = "github.com/oxequa/interact"
version = "1.1.1" version = "1.1.1"
[[constraint]] [[constraint]]

View File

@ -1,23 +1,16 @@
# Realize <p align="center">
<img src="https://i.imgur.com/vJfIiId.png" width="125px">
[![GoDoc](https://img.shields.io/badge/documentation-godoc-blue.svg?style=flat-square)](https://godoc.org/github.com/tockins/realize) </p>
[![Travis](https://img.shields.io/travis/tockins/realize.svg?style=flat-square)](https://travis-ci.org/tockins/realize) <p align="center">
[![AUR](https://img.shields.io/aur/license/yaourt.svg?style=flat-square)](https://raw.githubusercontent.com/tockins/realize/v1/LICENSE) <a href="https://travis-ci.org/oxequa/realize"><img src="https://img.shields.io/travis/oxequa/realize.svg?style=flat-square" alt="Build status"></a>
[![](https://img.shields.io/badge/realize-examples-yellow.svg?style=flat-square)](https://github.com/tockins/realize-examples) <a href="https://goreportcard.com/report/github.com/oxequa/realize"><img src="https://goreportcard.com/badge/github.com/oxequa/realize?style=flat-square" alt="GoReport"></a>
[![Gitter](https://img.shields.io/gitter/room/tockins/realize.svg?style=flat-square)](https://gitter.im/tockins/realize?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) <a href="http://godoc.org/github.com/oxequa/realize"><img src="http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square" alt="GoDoc"></a>
[![Go Report Card](https://goreportcard.com/badge/github.com/tockins/realize?style=flat-square)](https://goreportcard.com/report/github.com/tockins/realize) <a href="https://raw.githubusercontent.com/oxequa/realize/master/LICENSE"><img src="https://img.shields.io/aur/license/yaourt.svg?style=flat-square" alt="License"></a>
<!--[![OpenCollective](https://opencollective.com/realize/backers/badge.svg?style=flat-square)](#backers) <a href="https://gitter.im/oxequa/realize?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"><img src="https://img.shields.io/gitter/room/oxequa/realize.svg?style=flat-square" alt="Gitter"></a>
[![OpenCollective](https://opencollective.com/realize/sponsors/badge.svg?style=flat-square)](#sponsors)--> </p>
<hr>
<br> <h3 align="center">#1 Golang live reload and task runner</h3>
<hr>
<div align="center">
<img src="https://i.imgur.com/7XiZyR1.png" width="125px">
<h1 style="">The #1 Golang Task Runner</h1>
<p style="font-size: 18px; font-weight: 400;">Enhance your workflow by automating the most common tasks and using the best performing Golang live reloading.</p>
</div>
<br>
<p align="center"> <p align="center">
<img src="https://gorealize.io/img/realize-ui-2.png"> <img src="https://gorealize.io/img/realize-ui-2.png">
@ -45,15 +38,17 @@
- Export logs and errors to an external file. - Export logs and errors to an external file.
- Step-by-step project initialization. - Step-by-step project initialization.
- Redesigned panel that displays build errors, console outputs and warnings. - Redesigned panel that displays build errors, console outputs and warnings.
- Any suggestion? [Suggest an amazing feature! 🕺🏻](https://github.com/tockins/realize/issues/new) - Any suggestion? [Suggest an amazing feature! 🕺🏻](https://github.com/oxequa/realize/issues/new)
## Supporters ## Supporters
<p align="center"><br> <p align="center"><br>
<img src="http://gorealize.io/img/do_logo.png" width="180px"> <img src="http://gorealize.io/img/do_logo.png" width="180px">
</p> </p>
## Get started ## Quickstart
$ go get github.com/tockins/realize ```
go get github.com/oxequa/realize
```
## Commands List ## Commands List
@ -87,7 +82,7 @@ Some examples:
$ realize start --name="realize" --build $ realize start --name="realize" --build
$ realize start --path="realize" --run --no-config $ realize start --path="realize" --run --no-config
$ realize start --install --test --fmt --no-config $ realize start --install --test --fmt --no-config
$ realize start --path="/Users/username/go/src/github.com/tockins/realize-examples/coin/" $ realize start --path="/Users/username/go/src/github.com/oxequa/realize-examples/coin/"
If you want, you can specify additional arguments for your project: If you want, you can specify additional arguments for your project:
@ -126,7 +121,7 @@ Remove a project by its name
*** there is no more a .realize dir, but only a .realize.yaml file *** *** there is no more a .realize dir, but only a .realize.yaml file ***
For more examples check: [Realize Examples](https://github.com/tockins/realize-examples) For more examples check: [Realize Examples](https://github.com/oxequa/realize-examples)
settings: settings:
legacy: legacy:
@ -197,8 +192,8 @@ For more examples check: [Realize Examples](https://github.com/tockins/realize-e
errorOutputPattern: mypattern //custom error pattern errorOutputPattern: mypattern //custom error pattern
## Support and Suggestions ## Support and Suggestions
💬 Chat with us [Gitter](https://gitter.im/tockins/realize)<br> 💬 Chat with us [Gitter](https://gitter.im/oxequa/realize)<br>
⭐️ Suggest a new [Feature](https://github.com/tockins/realize/issues/new) ⭐️ Suggest a new [Feature](https://github.com/oxequa/realize/issues/new)
## Backers ## Backers

View File

@ -392,19 +392,19 @@ 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/settings/index.html": assetsAppComponentsSettingsIndexHtml, "assets/app/components/settings/index.html": assetsAppComponentsSettingsIndexHtml,
"assets/assets/css/app.css": assetsAssetsCssAppCss, "assets/assets/css/app.css": assetsAssetsCssAppCss,
"assets/assets/img/logo.png": assetsAssetsImgLogoPng, "assets/assets/img/logo.png": assetsAssetsImgLogoPng,
"assets/assets/img/svg/github-logo.svg": assetsAssetsImgSvgGithubLogoSvg, "assets/assets/img/svg/github-logo.svg": assetsAssetsImgSvgGithubLogoSvg,
"assets/assets/img/svg/ic_arrow_back_black_48px.svg": assetsAssetsImgSvgIc_arrow_back_black_48pxSvg, "assets/assets/img/svg/ic_arrow_back_black_48px.svg": assetsAssetsImgSvgIc_arrow_back_black_48pxSvg,
"assets/assets/img/svg/ic_clear_white_48px.svg": assetsAssetsImgSvgIc_clear_white_48pxSvg, "assets/assets/img/svg/ic_clear_white_48px.svg": assetsAssetsImgSvgIc_clear_white_48pxSvg,
"assets/assets/img/svg/ic_menu_white_48px.svg": assetsAssetsImgSvgIc_menu_white_48pxSvg, "assets/assets/img/svg/ic_menu_white_48px.svg": assetsAssetsImgSvgIc_menu_white_48pxSvg,
"assets/assets/img/svg/ic_settings_black_48px.svg": assetsAssetsImgSvgIc_settings_black_48pxSvg, "assets/assets/img/svg/ic_settings_black_48px.svg": assetsAssetsImgSvgIc_settings_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
@ -446,6 +446,7 @@ 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": &bintree{nil, map[string]*bintree{
"app": &bintree{nil, map[string]*bintree{ "app": &bintree{nil, map[string]*bintree{
@ -466,15 +467,15 @@ var _bintree = &bintree{nil, map[string]*bintree{
"img": &bintree{nil, map[string]*bintree{ "img": &bintree{nil, map[string]*bintree{
"logo.png": &bintree{assetsAssetsImgLogoPng, map[string]*bintree{}}, "logo.png": &bintree{assetsAssetsImgLogoPng, map[string]*bintree{}},
"svg": &bintree{nil, map[string]*bintree{ "svg": &bintree{nil, map[string]*bintree{
"github-logo.svg": &bintree{assetsAssetsImgSvgGithubLogoSvg, map[string]*bintree{}}, "github-logo.svg": &bintree{assetsAssetsImgSvgGithubLogoSvg, map[string]*bintree{}},
"ic_arrow_back_black_48px.svg": &bintree{assetsAssetsImgSvgIc_arrow_back_black_48pxSvg, map[string]*bintree{}}, "ic_arrow_back_black_48px.svg": &bintree{assetsAssetsImgSvgIc_arrow_back_black_48pxSvg, map[string]*bintree{}},
"ic_clear_white_48px.svg": &bintree{assetsAssetsImgSvgIc_clear_white_48pxSvg, map[string]*bintree{}}, "ic_clear_white_48px.svg": &bintree{assetsAssetsImgSvgIc_clear_white_48pxSvg, map[string]*bintree{}},
"ic_menu_white_48px.svg": &bintree{assetsAssetsImgSvgIc_menu_white_48pxSvg, map[string]*bintree{}}, "ic_menu_white_48px.svg": &bintree{assetsAssetsImgSvgIc_menu_white_48pxSvg, map[string]*bintree{}},
"ic_settings_black_48px.svg": &bintree{assetsAssetsImgSvgIc_settings_black_48pxSvg, map[string]*bintree{}}, "ic_settings_black_48px.svg": &bintree{assetsAssetsImgSvgIc_settings_black_48pxSvg, map[string]*bintree{}},
}}, }},
}}, }},
"js": &bintree{nil, map[string]*bintree{ "js": &bintree{nil, map[string]*bintree{
"all.js": &bintree{assetsAssetsJsAllJs, map[string]*bintree{}}, "all.js": &bintree{assetsAssetsJsAllJs, map[string]*bintree{}},
"all.min.js": &bintree{assetsAssetsJsAllMinJs, map[string]*bintree{}}, "all.min.js": &bintree{assetsAssetsJsAllMinJs, map[string]*bintree{}},
}}, }},
}}, }},
@ -528,4 +529,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, "/")...)...)
} }

View File

@ -65,7 +65,8 @@ func init() {
if build.Default.GOPATH == "" { if build.Default.GOPATH == "" {
log.Fatal("$GOPATH isn't set properly") log.Fatal("$GOPATH isn't set properly")
} }
if err := os.Setenv("GOBIN", filepath.Join(build.Default.GOPATH, "bin")); err != nil { path := filepath.SplitList(build.Default.GOPATH)
if err := os.Setenv("GOBIN", filepath.Join(path[len(path)-1], "bin")); err != nil {
log.Fatal(err) log.Fatal(err)
} }
} }

View File

@ -69,7 +69,7 @@ type Project struct {
} }
// Last is used to save info about last file changed // Last is used to save info about last file changed
type last struct{ type last struct {
file string file string
time time.Time time time.Time
} }
@ -495,7 +495,7 @@ func (p *Project) walk(path string, info os.FileInfo, err error) error {
result := p.watcher.Walk(path, p.init) result := p.watcher.Walk(path, p.init)
if result != "" { if result != "" {
if p.parent.Settings.Recovery.Index { if p.parent.Settings.Recovery.Index {
log.Println("Indexing",path) log.Println("Indexing", path)
} }
p.tools(p.stop, path, info) p.tools(p.stop, path, info)
if info.IsDir() { if info.IsDir() {
@ -596,6 +596,9 @@ func (p *Project) run(path string, stream chan Response, stop <-chan bool) (err
name = filepath.Base(dirPath) name = filepath.Base(dirPath)
} }
path = filepath.Join(dirPath, name) path = filepath.Join(dirPath, name)
if p.Tools.Run.Method != "" {
path = p.Tools.Run.Method
}
if _, err := os.Stat(path); err == nil { if _, err := os.Stat(path); err == nil {
build = exec.Command(path, args...) build = exec.Command(path, args...)
} else if _, err := os.Stat(path + RExtWin); err == nil { } else if _, err := os.Stat(path + RExtWin); err == nil {