arns-lt-tree-push-service/collector.go

28 lines
470 B
Go
Raw Normal View History

2022-08-02 05:16:11 +00:00
package main
import (
2023-06-29 12:33:25 +00:00
"log"
2022-08-02 05:16:11 +00:00
"os"
2024-01-10 06:34:50 +00:00
zord_tree "g.arns.lt/zordsdavini/zord-tree"
)
var config = zord_tree.NewConfig(
[]string{".md"},
"__a",
customMeta,
[]string{"\\.sync_.{12}\\.db"},
2022-08-02 05:16:11 +00:00
)
func Collect() {
2023-06-29 12:33:25 +00:00
log.Println("Collect: start")
2022-08-02 05:16:11 +00:00
if _, err := os.Stat(source); os.IsNotExist(err) {
2023-06-29 12:33:25 +00:00
log.Print(err)
2022-08-02 05:16:11 +00:00
panic("Source directory does not exist.")
}
2023-06-29 12:33:25 +00:00
log.Println("Collect: pre")
2024-01-10 06:34:50 +00:00
_ = zord_tree.PopulateTree(source, meta, config)
2023-06-29 12:33:25 +00:00
log.Println("Collect: post")
2022-08-02 05:16:11 +00:00
}