This commit is contained in:
parent
712ef52265
commit
71990c4f7c
@ -47,7 +47,7 @@ func remove(cmd *cobra.Command, args []string) (err error) {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
for _, arg := range args {
|
for _, arg := range args {
|
||||||
err := r.Remove(arg)
|
err = r.Remove(arg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(r.Prefix(haunt.Red.Bold(arg + " project not found")))
|
log.Println(r.Prefix(haunt.Red.Bold(arg + " project not found")))
|
||||||
continue
|
continue
|
||||||
|
@ -81,9 +81,9 @@ func (r *Haunt) SetDefaults() {
|
|||||||
r.Settings.FileLimit = 0
|
r.Settings.FileLimit = 0
|
||||||
r.Settings.Legacy.Interval = 100 * time.Millisecond
|
r.Settings.Legacy.Interval = 100 * time.Millisecond
|
||||||
r.Settings.Legacy.Force = false
|
r.Settings.Legacy.Force = false
|
||||||
r.Settings.Files.Errors = Resource{Name: FileErr, Status: false}
|
r.Settings.Errors = Resource{Name: FileErr, Status: false}
|
||||||
r.Settings.Files.Errors = Resource{Name: FileOut, Status: false}
|
r.Settings.Errors = Resource{Name: FileOut, Status: false}
|
||||||
r.Settings.Files.Errors = Resource{Name: FileLog, Status: false}
|
r.Settings.Errors = Resource{Name: FileLog, Status: false}
|
||||||
if _, err := os.Stat("main.go"); err == nil {
|
if _, err := os.Stat("main.go"); err == nil {
|
||||||
log.Println(r.Prefix(Green.Bold("Adding: " + filepath.Base(Wdir()))))
|
log.Println(r.Prefix(Green.Bold("Adding: " + filepath.Base(Wdir()))))
|
||||||
r.Projects = append(r.Projects, Project{
|
r.Projects = append(r.Projects, Project{
|
||||||
@ -137,7 +137,7 @@ func (r *Haunt) SetDefaults() {
|
|||||||
|
|
||||||
// Stop haunt workflow
|
// Stop haunt workflow
|
||||||
func (r *Haunt) Stop() error {
|
func (r *Haunt) Stop() error {
|
||||||
for k := range r.Schema.Projects {
|
for k := range r.Projects {
|
||||||
if r.Schema.Projects[k].exit != nil {
|
if r.Schema.Projects[k].exit != nil {
|
||||||
close(r.Schema.Projects[k].exit)
|
close(r.Schema.Projects[k].exit)
|
||||||
}
|
}
|
||||||
|
@ -250,13 +250,13 @@ func (w *filePoller) watch(f *os.File, lastFi os.FileInfo, chClose chan struct{}
|
|||||||
// If it doesn't exist at this point, it must have been removed
|
// If it doesn't exist at this point, it must have been removed
|
||||||
// no need to send the error here since this is a valid operation
|
// no need to send the error here since this is a valid operation
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
if err := w.sendEvent(fsnotify.Event{Op: fsnotify.Remove, Name: f.Name()}, chClose); err != nil {
|
if err = w.sendEvent(fsnotify.Event{Op: fsnotify.Remove, Name: f.Name()}, chClose); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
lastFi = nil
|
lastFi = nil
|
||||||
}
|
}
|
||||||
// at this point, send the error
|
// at this point, send the error
|
||||||
err := w.sendErr(err, chClose)
|
err = w.sendErr(err, chClose)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(log.Prefix(), err.Error())
|
log.Println(log.Prefix(), err.Error())
|
||||||
}
|
}
|
||||||
|
@ -591,7 +591,7 @@ func (p *Project) run(path string, stream chan Response, stop <-chan bool) (err
|
|||||||
// https://github.com/golang/go/issues/5615
|
// https://github.com/golang/go/issues/5615
|
||||||
// https://github.com/golang/go/issues/6720
|
// https://github.com/golang/go/issues/6720
|
||||||
if build != nil {
|
if build != nil {
|
||||||
err := build.Process.Signal(os.Interrupt)
|
err = build.Process.Signal(os.Interrupt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(p.parent.Prefix("Failed to send interrupt: " + err.Error()))
|
log.Println(p.parent.Prefix("Failed to send interrupt: " + err.Error()))
|
||||||
}
|
}
|
||||||
@ -635,9 +635,9 @@ func (p *Project) run(path string, stream chan Response, stop <-chan bool) (err
|
|||||||
if p.Tools.Run.Method != "" {
|
if p.Tools.Run.Method != "" {
|
||||||
path = 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 {
|
||||||
build = exec.Command(path+RExtWin, args...)
|
build = exec.Command(path+RExtWin, args...)
|
||||||
} else {
|
} else {
|
||||||
if _, err = os.Stat(path); err == nil {
|
if _, err = os.Stat(path); err == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user