Browse Source

Added .html and .tmpl extensions to watchlist

Wirecog 7 years ago
parent
commit
25d05fb7b4
3 changed files with 12 additions and 1 deletions
  1. 2
    1
      kick.go
  2. 5
    0
      startstop_unixlike.go
  3. 5
    0
      startstop_windows.go

+ 2
- 1
kick.go View File

@@ -50,6 +50,7 @@ func restart(cmd *exec.Cmd) *exec.Cmd {
50 50
 
51 51
 func initializeWatcher(shouldRestart chan bool, dirList []string) {
52 52
 
53
+	supportedExtensions := map[string]int{".go": 1, ".html": 1, ".tmpl": 1}
53 54
 	watcher, err := fsnotify.NewWatcher()
54 55
 	if err != nil {
55 56
 		log.Fatal(err)
@@ -63,7 +64,7 @@ func initializeWatcher(shouldRestart chan bool, dirList []string) {
63 64
 			case event := <-watcher.Events:
64 65
 
65 66
 				if event.Op == fsnotify.Write || event.Op == fsnotify.Rename {
66
-					if filepath.Ext(event.Name) == ".go" {
67
+					if _, ok := supportedExtensions[filepath.Ext(event.Name)]; ok {
67 68
 						shouldRestart <- true
68 69
 					}
69 70
 				}

+ 5
- 0
startstop_unixlike.go View File

@@ -1,3 +1,8 @@
1
+// The Isomorphic Go Project
2
+// Copyright (c) Wirecog, LLC. All rights reserved.
3
+// Use of this source code is governed by a BSD-style
4
+// license, which can be found in the LICENSE file.
5
+
1 6
 // +build !windows
2 7
 
3 8
 package main

+ 5
- 0
startstop_windows.go View File

@@ -1,3 +1,8 @@
1
+// The Isomorphic Go Project
2
+// Copyright (c) Wirecog, LLC. All rights reserved.
3
+// Use of this source code is governed by a BSD-style
4
+// license, which can be found in the LICENSE file.
5
+
1 6
 // +build windows
2 7
 
3 8
 package main