run/fast slash fixed
This commit is contained in:
parent
2c40a0ebf7
commit
a0aace6733
|
@ -31,12 +31,13 @@ func (p *Project) GoRun(channel chan bool, runner chan bool, wr *sync.WaitGroup)
|
|||
stop := make(chan bool, 1)
|
||||
var run string
|
||||
|
||||
if len(name) == 1 {
|
||||
name := strings.Split(p.base, "/")
|
||||
if name[len(name)-1] == "" {
|
||||
name := strings.Split(slash(p.base), "/")
|
||||
run = name[len(name)-1]
|
||||
} else {
|
||||
run = name[len(name)-1]
|
||||
}
|
||||
|
||||
build := exec.Command(slash(os.Getenv("GOBIN")) + slash(run))
|
||||
build.Dir = p.base
|
||||
defer func() {
|
||||
|
|
|
@ -45,6 +45,7 @@ func (h *Config) Fast(params *cli.Context) error {
|
|||
fast := h.Projects[0]
|
||||
// Takes the values from config if wd path match someone else
|
||||
if params.Bool("config") {
|
||||
fmt.Println(params.Bool("config"))
|
||||
if err := h.Read(); err == nil {
|
||||
for _, val := range h.Projects {
|
||||
if fast.Path == val.Path {
|
||||
|
@ -104,7 +105,6 @@ func (p *Project) Watching() {
|
|||
defer end()
|
||||
|
||||
p.base = base + p.Path
|
||||
|
||||
for _, dir := range p.Watcher.Paths {
|
||||
// check main existence
|
||||
dir = slash(dir)
|
||||
|
@ -230,10 +230,8 @@ func slash(str string) string {
|
|||
str = "/" + str
|
||||
}
|
||||
if string(str[len(str)-1]) == "/" {
|
||||
if len(str) == 0 {
|
||||
if string(str) == "/" {
|
||||
return str
|
||||
} else if string(str) == "/" {
|
||||
str = ""
|
||||
} else {
|
||||
str = str[0 : len(str)-1]
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue