arns-lt-tree-push-service/main.go
Arnas Udovicius 6c2775f58c
Some checks failed
continuous-integration/drone/push Build is failing
Merge remote-tracking branch 'origin/master'
2022-08-22 23:00:03 +03:00

39 lines
872 B
Go

package main
import (
"flag"
"time"
)
var (
source string
dest string
key string
meta = []string{"description", "lang", "copyright", "created"} //_ = zord_tree.PopulateTree(cfg.MdTree.Path, cfg.MdTree.DPath, meta)
customMeta = make(map[string]func() string)
key = "WgiPGpt5wM6SVEWo5iqI"
)
func init() {
flag.StringVar(&dest, "dest", "", "destination directory to read from")
flag.StringVar(&source, "source", "", "source to collect texts.")
flag.StringVar(&key, "key", "", "secret key for authenticated communication.")
flag.Parse()
customMeta["copyright"] = func() string {
return "CC-BY-SA 4.0"
}
customMeta["created"] = func() string {
currentTime := time.Now()
return currentTime.Format("2006-01-02")
}
}
func main() {
switch action := flag.Arg(0); action {
case "collect":
Collect()
default:
Run()
}
}