lastchange field
This commit is contained in:
parent
3fe830030f
commit
2b79bbef99
@ -8,6 +8,7 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
const(
|
const(
|
||||||
@ -31,9 +32,11 @@ type Project struct {
|
|||||||
Build bool `yaml:"app_build,omitempty"`
|
Build bool `yaml:"app_build,omitempty"`
|
||||||
Main string `yaml:"app_main,omitempty"`
|
Main string `yaml:"app_main,omitempty"`
|
||||||
Watcher Watcher `yaml:"app_watcher,omitempty"`
|
Watcher Watcher `yaml:"app_watcher,omitempty"`
|
||||||
|
updatedAt time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
type Watcher struct{
|
type Watcher struct{
|
||||||
|
// different before and after on rerun?
|
||||||
Before []string `yaml:"before,omitempty"`
|
Before []string `yaml:"before,omitempty"`
|
||||||
After []string `yaml:"after,omitempty"`
|
After []string `yaml:"after,omitempty"`
|
||||||
Paths []string `yaml:"paths,omitempty"`
|
Paths []string `yaml:"paths,omitempty"`
|
||||||
@ -84,11 +87,14 @@ func (h *Config) Clean() {
|
|||||||
// Check, Read and remove duplicates from the config file
|
// Check, Read and remove duplicates from the config file
|
||||||
func (h *Config) Read() error{
|
func (h *Config) Read() error{
|
||||||
if file, err := ioutil.ReadFile(h.file); err == nil{
|
if file, err := ioutil.ReadFile(h.file); err == nil{
|
||||||
err = yaml.Unmarshal(file, h)
|
if len(h.Projects) <= 0 {
|
||||||
if err == nil {
|
err = yaml.Unmarshal(file, h)
|
||||||
h.Clean()
|
if err == nil {
|
||||||
|
h.Clean()
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
return err
|
return errors.New("There are no projects")
|
||||||
}else{
|
}else{
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user