1
0
mirror of https://github.com/thebaer/tildes.git synced 2018-07-20 07:15:21 +00:00

Exclude hidden and .log files

This commit is contained in:
Matt Baer 2015-01-25 23:08:10 -05:00
parent faccca5464
commit e7baccc156

View File

@ -32,7 +32,14 @@ func findProjects() map[string]User {
for _, path := range files {
pparts := strings.Split(path, "/")
uname := pparts[2]
proj := &Project{Name: filepath.Base(path), Path: strings.Replace(path, "/home/", "~", -1)}
fname := filepath.Base(path)
// Exclude certain files
if strings.HasPrefix(fname, ".") || strings.HasSuffix(fname, ".log") {
continue
}
proj := &Project{Name: fname, Path: strings.Replace(path, "/home/", "~", -1)}
u, exists := users[uname]
if !exists {
fmt.Printf("Found Code for ~%s.\n", uname)