This commit is contained in:
alessio 2016-08-18 01:35:37 +02:00
parent d0a68bb541
commit 2105eff1e0
5 changed files with 96 additions and 98 deletions

View File

@ -1,9 +1,9 @@
package main
import (
"os"
"gopkg.in/urfave/cli.v2"
r "github.com/tockins/realize/realize"
"gopkg.in/urfave/cli.v2"
"os"
)
func main() {

View File

@ -1,10 +1,10 @@
package realize
import (
"github.com/fatih/color"
"sync"
"fmt"
"github.com/fatih/color"
"log"
"sync"
)
const (
@ -61,4 +61,3 @@ func (app *App) Information() {
fmt.Println(blue(app.Name) + " - " + blue(app.Version))
fmt.Println(bluel(app.Description) + "\n")
}

View File

@ -1,12 +1,12 @@
package realize
import (
"os"
"gopkg.in/yaml.v2"
"errors"
"gopkg.in/urfave/cli.v2"
"io/ioutil"
"fmt"
"gopkg.in/urfave/cli.v2"
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
)
type Config struct {
@ -169,5 +169,3 @@ func (h *Config) List() error {
return err
}
}

View File

@ -1,14 +1,14 @@
package realize
import (
"time"
"os/exec"
"os"
"bytes"
"bufio"
"bytes"
"log"
"sync"
"os"
"os/exec"
"strings"
"sync"
"time"
)
type Project struct {
@ -107,4 +107,3 @@ func (p *Project) GoInstall() error {
}
return nil
}

View File

@ -1,14 +1,14 @@
package realize
import (
"github.com/fsnotify/fsnotify"
"fmt"
"path/filepath"
"os"
"strings"
"github.com/fsnotify/fsnotify"
"log"
"time"
"os"
"path/filepath"
"strings"
"sync"
"time"
)
type Watcher struct {
@ -41,12 +41,12 @@ func (p *Project) Watching() {
var wr sync.WaitGroup
var watcher *fsnotify.Watcher
watcher, err := fsnotify.NewWatcher()
if(err != nil){
if err != nil {
Fail(p.Name + ": \t" + err.Error())
}
channel := make(chan bool, 1)
base, err := os.Getwd()
if(err != nil){
if err != nil {
Fail(p.Name + ": \t" + err.Error())
}
@ -66,7 +66,9 @@ func (p *Project) Watching() {
routines := func() {
channel = make(chan bool)
wr.Add(1)
go p.build(); p.install(); p.run(channel, &wr);
go p.build()
p.install()
p.run(channel, &wr)
}
end := func() {
watcher.Close()
@ -198,7 +200,7 @@ func slash(str string) string{
str = "/" + str
}
if string(str[len(str)-1]) == "/" {
if(string(str) == "/"){
if string(str) == "/" {
str = ""
} else {
str = str[0 : len(str)-2]