This commit is contained in:
alessio 2017-04-01 20:50:06 +02:00
parent dfda110f56
commit 5678759cef
3 changed files with 8 additions and 6 deletions

View File

@ -21,7 +21,7 @@ type Config struct {
Legacy `yaml:"legacy,omitempty" json:"legacy,omitempty"` Legacy `yaml:"legacy,omitempty" json:"legacy,omitempty"`
} }
// Polling configuration // Legacy configuration
type Legacy struct { type Legacy struct {
Status bool `yaml:"status" json:"status"` Status bool `yaml:"status" json:"status"`
Interval time.Duration `yaml:"interval" json:"interval"` Interval time.Duration `yaml:"interval" json:"interval"`

View File

@ -31,15 +31,17 @@ func (s Settings) Fatal(err error, msg ...interface{}) {
} }
} }
func (h Settings) Name(name string, path string) string { // Name return the project name or the path of the working dir
func (s Settings) Name(name string, path string) string {
if name == "" && path == "" { if name == "" && path == "" {
return h.Wdir() return s.Wdir()
} else if path != "/" { } else if path != "/" {
return filepath.Base(path) return filepath.Base(path)
} }
return name return name
} }
func (h Settings) Path(s string) string { // Path cleaner
return strings.Replace(filepath.Clean(s), "\\", "/", -1) func (s Settings) Path(path string) string {
return strings.Replace(filepath.Clean(path), "\\", "/", -1)
} }

View File

@ -68,7 +68,7 @@ type Command struct {
Path string `yaml:"path" json:"path"` Path string `yaml:"path" json:"path"`
} }
// File determinates the status of each log files (streams, logs, errors) // Streams is a collection of names and values for the logs functionality
type Streams struct { type Streams struct {
CliOut bool `yaml:"cli_out" json:"cli_out"` CliOut bool `yaml:"cli_out" json:"cli_out"`
FileOut bool `yaml:"file_out" json:"file_out"` FileOut bool `yaml:"file_out" json:"file_out"`