fast command additional params

This commit is contained in:
alessio 2016-08-21 23:31:02 +02:00
parent ccbab021e4
commit a555c2c0ff
1 changed files with 10 additions and 7 deletions

View File

@ -3,6 +3,7 @@ package realize
import ( import (
"fmt" "fmt"
"github.com/fsnotify/fsnotify" "github.com/fsnotify/fsnotify"
"gopkg.in/urfave/cli.v2"
"log" "log"
"math/big" "math/big"
"os" "os"
@ -40,14 +41,16 @@ func (h *Config) Watch() error {
} }
// Fast method run a project from his working directory without makes a config file // Fast method run a project from his working directory without makes a config file
func (h *Config) Fast() error { func (h *Config) Fast(params *cli.Context) error {
fast := h.Projects[0] fast := h.Projects[0]
// Takes the values from config if wd path match with another path // Takes the values from config if wd path match someone else
if err := h.Read(); err == nil { if params.Bool("config") {
for _, val := range h.Projects { if err := h.Read(); err == nil {
fmt.Println(val) for _, val := range h.Projects {
if fast.Path == val.Path { fmt.Println(val)
fast = val if fast.Path == val.Path {
fast = val
}
} }
} }
} }