Skip to content

Commit 4248e6d

Browse files
committed
CLI choose which config file type
1 parent 5a428a4 commit 4248e6d

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

cmd/refresh/main.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,14 @@ func main() {
4545
}
4646

4747
if len(configPath) != 0 {
48-
watch, err := refresh.NewEngineFromTOML(configPath)
48+
// If toml vs yaml
49+
var err error
50+
var watch *refresh.Engine
51+
if strings.Contains(configPath, ".toml") {
52+
watch, err = refresh.NewEngineFromTOML(configPath)
53+
} else if strings.Contains(configPath, ".yaml") {
54+
watch, err = refresh.NewEngineFromYAML(configPath)
55+
}
4956
if err != nil {
5057
} else {
5158
ignore := refresh.Ignore{

cmd/refresh/refresh

-3.89 MB
Binary file not shown.

0 commit comments

Comments
 (0)