1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2025-11-12 05:23:01 +00:00

Play with stuff

This commit is contained in:
Timur Ismagilov
2022-02-04 03:39:21 +05:00
committed by Timur Ismagilov
parent 1c317e39aa
commit d0dbbe4714
4 changed files with 8 additions and 10 deletions

View File

@@ -23,7 +23,7 @@ func Index(path string) {
if oh := ByName(h.name); oh.Exists {
oh.mergeIn(h)
} else {
h.insert()
insert(h)
}
}
log.Println("Indexed", Count(), "hyphae")
@@ -40,10 +40,8 @@ func indexHelper(path string, nestLevel uint, ch chan *Hypha) {
for _, node := range nodes {
// If this hypha looks like it can be a hypha path, go deeper. Do not
// touch the .git and static folders for they have an administrative
// importance!
if node.IsDir() && IsValidName(node.Name()) && node.Name() != ".git" &&
!(nestLevel == 0 && node.Name() == "static") {
// touch the .git folders for it has an administrative importance!
if node.IsDir() && IsValidName(node.Name()) && node.Name() != ".git" {
indexHelper(filepath.Join(path, node.Name()), nestLevel+1, ch)
continue
}