aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/main.go b/main.go
index a783bef..0888e93 100644
--- a/main.go
+++ b/main.go
@@ -40,14 +40,23 @@ var (
BuildCommand []string
// Command run after build
RunCommand []string
- // Command will only run on files that have the Ext extension
- Ext string
+ // Command will only run on files that have the Extensions extension
+ Extensions []string
+)
+
const (
DateLayout string = "15:04:05"
)
func CompileRun(fileName string) {
- if !strings.HasSuffix(fileName, Ext) {
+ found := false
+ for _, Ext := range Extensions {
+ if strings.HasSuffix(fileName, Ext) {
+ found = true
+ break
+ }
+ }
+ if !found {
return
}
@@ -129,7 +138,7 @@ func main() {
BuildCommand = strings.Split(*bc, " ")
RunCommand = strings.Split(*rc, " ")
- Ext = *e
+ Extensions = strings.Split(*e, ",")
Path = *p
fmt.Printf("[%s watching '%s'%s]\n", Cyan, Path, Reset)