示例#1
0
// DefaultIgnorePathFn checks whether a path is ignored. Currently defaults
// to hidden files on *nix systems, ie they start with a ".".
func DefaultIgnorePathFn(path string) bool {
	if strings.HasPrefix(path, ".") || strings.Contains(path, "/.") {
		return true
	}

	// ignore node
	if strings.HasPrefix(path, "node_modules") || strings.Contains(path, "/node_modules") {
		return true
	}

	// vim creates random numeric files
	base := filepath.Base(path)
	if str.IsNumeric(base) {
		return true
	}
	return false
}
示例#2
0
文件: watcher.go 项目: THEY/godo
func isVimFile(path string) bool {
	base := filepath.Base(path)
	return str.IsNumeric(base)
}