diff options
-rw-r--r-- | main.go | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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) |